Binary File Descriptor library


The Binary File Descriptor library is the GNU Project's main mechanism for the portable manipulation of object files in a variety of formats., it supports approximately 50 file formats for some 25 instruction set architectures.

History

When David Henkel-Wallace of Cygnus Support proposed developing the library as a way to open up new business opportunities for the company, Richard Stallman said that it would be difficult; David's response was that it wasn't such a "Big Fucking Deal". Abbreviated to "BFD", this became the library name. "Binary File Descriptor" was invented later as a backronym for "BFD".

Design

BFD works by presenting a common abstract view of object files. An object file has a "header" with descriptive info; a variable number of "sections" that each has a name, some attributes, and a block of data; a symbol table; relocation entries; and so forth.
Internally, BFD translates the data from the abstract view into the details of the bit/byte layout required by the target processor and file format. Its key services include handling byte order differences, such as between a little-endian host and big-endian target, correct conversion between 32-bit and 64-bit data, and details of address arithmetic specified by relocation entries.
Although BFD was originally designed to be a generic library usable by a wide variety of tools, the frequent need to tinker with the API to accommodate new systems' capabilities has tended to limit its use; BFD's main clients are the GNU Assembler, GNU Linker, and other GNU Binary Utilities tools, and the GNU Debugger. As a result, BFD is not distributed separately, but is always included with releases of binutils and GDB. Nevertheless, BFD is a critical component in the use of GNU tools for embedded systems development.
The BFD library can be used to read the structured data out of a core dump.