[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Another way to look at the BFD library is to divide it into three parts by the manner in which it is used.
The first use is to read an object file. The object file readers are programs like `gdb', `nm', `objdump', and `objcopy'. These programs use BFD to view an object file in a generic form. The official BFD interface is normally fully adequate for these programs.
The second use is to write an object file. The object file writers are programs like `gas' and `objcopy'. These programs use BFD to create an object file. The official BFD interface is normally adequate for these programs, but for some object file formats the assembler needs some additional hooks in order to set particular flags or other information. The official BFD interface includes functions to copy private information from one object file to another, and these functions are used by `objcopy' to avoid information loss.
The third use is to link object files. There is only one object file linker, `ld'. Originally, `ld' was an object file reader and an object file writer, and it did the link operation using the generic BFD structures. However, this turned out to be too slow and too memory intensive.
The official BFD linker functions were written to permit specific BFD backends to perform the link without translating through the generic structures, in the normal case where all the input files and output file have the same object file format. Not all of the backends currently implement the new interface, and there are default linking functions within BFD which use the generic structures and which work with all backends.
For several object file formats the linker needs additional hooks which are not provided by the official BFD interface, particularly for dynamic linking support. These functions are typically called from the linker emulation template.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |