From: Chris J. <ch...@rt...> - 2011-11-21 12:03:59
|
Hello, I am developing a linker for the RTEMS project to support dynamic loading. I have just switched from the GPL libelf to your libelf after taking a look in the FreeBSD kernel. I am pleased to report there are no problems with the testing I have done. Our use of libelf is fairly basic. You can find the RTEMS project at http://www.rtems.org/ and the linker's code is: http://www.rtems.org/ftp/pub/rtems/people/chrisj/rtl/rtl-host-20111121.tar.bz2 To build install waf and then 'waf configure build'. I plan to submit clean patches once I have the work completed. I have copied in just the libelf and common directories. The code is built using waf and I can currently build on Linux (CentOS5), MacOS (Snow Leopard) and FreeBSD (v9). Windows is a work in progress and the reason for the post. Some background. RTEMS supports around 12 architectures and all are ELF based. We need something to play with ELF files at a container level. The linker uses files, sections, and symbols and not much else. The low level target specific code is located in RTEMS and runs on the target hardware. So far I can handle SPARC, M68K and i386 ELF files on MacOS with the same executable. I do not expect problems in the other host operating systems. Windows is a little more difficult to support. The couple of issues I have so far are: 1. Includes such as "#include <sys/errno.h>", and "#include <sys/cdefs.h>" are not supported. I have worked around this issue with a win32 specific include directory that maps to the standard headers in my application. 2. There is no mmap call. I see: LIBELF_F_RAWFILE_MALLOC | LIBELF_F_SPECIAL_FILE could be used but I am not sure about a couple of things. Does this read the whole ELF file into memory ? Secondly, I really do not like the idea of __WIN32__ all over the place. I can support "HAVE_CONFIG_H" and "HAVE_MMAP" etc. How should I handle this ? Any guidance or suggestions would be most welcome. Chris |