This is an old revision of the document!


LibElf

This is a BSD-licensed implementation of the elf(3) API.

In the absence of a standard API to read and manipulate ELF objects, many of our tools implement adhoc ELF parsers in them. Such tools include:

  • btxld(8): reads and parses the ELF header when loading files.
  • elfdump(1): displays information about ELF files.
  • gprof(1): reporting tool for cc -pg profiling.
  • kgzip(8): compresses a kernel.
  • pmcstat(8): performance monitoring controller for PMC based profiling.
  • readelf(1): prints information about ELF files.

(In addition to these, file(1) in src/contrib/file/ and the GNU binutils programs in src/contrib/binutils/ also parse ELF files.)

Ideally, we would like our tools that analyse ELF files to be as machine-independent as possible. This would allow them to be used as cross tools. For example, pmcstat would be able to analyse hwpmc logs from an embedded device of a different architecture than the machine that it is running in on.

Also, the availability of an in-house ELF parsing library would also help if and when we create BSD licensed versions of ld(1) or a native debugger or other program analysis tools.

The elf(3) API appears to have been developed in SVR4 and is currently in use in Solaris. An LGPLed implementation of this API is present in some Linux-based operating systems.

libelf is being developed in FreeBSD's Perforce repository.

P4:[http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/user/jkoshy/projects/libbsdelf //depot/user/jkoshy/projects/libbsdelf]

  • libelf.1149433722.txt.gz
  • Last modified: 2006/06/04 15:08
  • by JosephKoshy