[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2 BFD ELF generic support

In general, functions which do not read external data from the ELF file are found in `elf.c'. They operate on the internal forms of the ELF structures, which are defined in `include/elf/internal.h'. The internal structures are defined in terms of `bfd_vma', and so may be used for both 32 bit and 64 bit ELF targets.

The file `elfcode.h' contains functions which operate on the external data. `elfcode.h' is compiled twice, once via `elf32.c' with `ARCH_SIZE' defined as `32', and once via `elf64.c' with `ARCH_SIZE' defined as `64'. `elfcode.h' includes functions to swap the ELF structures in and out of external form, as well as a few more complex functions.

Linker support is found in `elflink.c'. The linker support is only used if the processor specific file defines `elf_backend_relocate_section', which is required to relocate the section contents. If that macro is not defined, the generic linker code is used, and relocations are handled via `bfd_perform_relocation'.

The core file support is in `elfcore.h', which is compiled twice, for both 32 and 64 bit support. The more interesting cases of core file support only work on a native system which has the `sys/procfs.h' header file. Without that file, the core file support does little more than read the ELF program segments as BFD sections.

The BFD internal header file `elf-bfd.h' is used for communication among these files and the processor specific files.

The default entries for the BFD ELF target vector are found mainly in `elf.c'. Some functions are found in `elfcode.h'.

The processor specific files may override particular entries in the target vector, but most do not, with one exception: the `bfd_reloc_type_lookup' entry point is always processor specific.



This document was generated by system on December, 2 2004 using texi2html