This is the public release of libelf-0.7.0, a free ELF object file access library. If you have problems with applications that use libelf and work with the commercial (SVR4, Solaris) version but not with this one, please contact me. IMPORTANT NOTE: If you have libelf-0.5.2 installed, you probably have a file .../include/elf.h that contains the single line ``#include ''. REMOVE THIS FILE BEFORE YOU RUN configure. Installation is straightforward - the package is autoconf'ed. Just do ``cd libelf-0.7.0; ./configure; make; make install''. Header files will be installed in .../include/libelf/. If your system does not provide its own version of libelf.h or nlist.h, you may want to run ``make install-compat'' to install them. I recommend that you use ``-I.../include/libelf'' instead. If you are running Linux with libc 5.* as the default C library, and you plan to use the 64-bit functions, you must either use ``-I.../include/libelf'', or remove /usr/include/libelf.h and run ``make install-compat''. Libc 6.* (aka glibc2) doesn't have its own or , so ``make install-compat'' alone will be sufficient. You need an ANSI C compiler to build libelf. Gcc is optimal. On some systems you can build and install a shared libelf library. To do this, pass ``--enable-shared'' to configure. Another configure option, ``--enable-debug'', adds debugging code to libelf; if you don't run into problems, you will probably not need it. If you build a shared library and want it to be installed as ``libelf-0.7.0.so'' rather than ``libelf.so.0.7.0'', please use ``./configure --enable-shared --enable-gnu-names''. Other files, e.g. ``libelf.so'' and ``libelf.so.0'' are NOT affected. When creating an ELF shared library, it is possible to add references to other shared libraries in the DYNAMIC section of the resulting file. The make variable DEPSHLIBS contains a list of libraries to add. It is set to ``-lc'' on Linux systems, and empty otherwise. To override this setting, use something like ``make DEPSHLIBS="-la -lb"''. NLS is available and enabled by default (although there are no message catalogs included in the distribution (yet)). To turn it off, pass the ``--disable-nls'' option to configure. Libelf can use gettext or catgets for accessing message catalogs. If gettext is available AND is part of libc (i.e. not in a separate library), it will be used. Otherwise, configure will look for catgets. If you have gettext in a separate library and want to use it, you should pass the library's name to configure, e.g. ``LIBS=-lintl ./configure''. Note that you MUST link your libelf-based applications with -lintl then, which is probably not what you want, or change the DEPSHLIBS variable described above (in case you're building a shared library). If you have GNU gettext installed on your system, and if GNU gettext runs on top of the catgets interface (Linux systems), configure will refuse to use it and use catgets instead. If you absolutely want to use GNU gettext, go ahead and rebuild it (which is IMHO a good idea in general in this case): cd .../gettext-0.10 ac_cv_func_catgets=no ac_cv_func_gettext=no ./configure make make install After that, return to the libelf build directory, remove config.cache, and start over. *** 64-bit support *** Starting with libelf-0.7.0, libelf also supports 64-bit ELF files. This is enabled by default unless your system (or your compiler) does not support 64-bit integers, or lacks 64-bit declarations in . If you have problems building with 64-bit support, please do ./configure --disable-elf64 for the moment, and contact me. Please note that I haven't tested 64-bit support (I still don't have access to any 64-bit systems). There are still some unresolved problems, e.g. IRIX uses different Elf64_Rel and Elf64_Rela structures (they replaced the r_info member), and the enumeration values for Elf_Type differ from the commercial (SVR4) implementation of libelf - they broke binary compatibility for no good reason, and I'm not willing to follow their footsteps. The result is that libelf-0.7.0 ist upward compatible with libelf-0.6.4 (as it should be) but INCOMPATIBLE WITH SVR4 LIBELF. If you have both versions installed, you'd better make sure that you link with the library that matches the you're #include'ing. Missing things: * There is no documentation. * The COFF file format is not understood. * nlist(3) is incomplete; the n_type and n_sclass members of struct nl are set to zero even if type information is available. Changes since 0.6.4: * Fixed configure for IRIX systems * Added check for truncated archive members * Added check for misaligned SHDR/PHDR tables * Support for building libelf together with GNU libc * Added elf_memory(3) * Added 64-bit support Changes since 0.5.2: * some bug fixes * mmap support * new directory layout * There is a new function, elf_delscn(), that deletes a section from an ELF file. It also adjusts the sh_link and sh_info members in the section header table, if (and ONLY if) the ELF standard indicates that these values are section indices. References to the deleted section will be cleared, so be careful. * my email address has changed ;) Where to get libelf: ftp://sunsite.unc.edu/pub/Linux/libs/ ftp://ftp.stud.uni-hannover.de/pub/users/michael/ http://www.stud.uni-hannover.de/~michael/software/ Michael "Tired" Riepe