Relocating the section contents




Relocating the section contents - Untitled















Next: Writing the symbol table,
Previous: Information provided by the linker,
Up: Performing the Final Link



2.17.3.2 Relocating the section contents

The _bfd_final_link function should look through the
link_order structures attached to each section of the
output file. Each link_order structure should either be
handled specially, or it should be passed to the function
_bfd_default_link_order which will do the right thing
(_bfd_default_link_order is defined in linker.c).

For efficiency, a link_order of type
bfd_indirect_link_order whose associated section belongs
to a BFD of the same format as the output BFD must be handled
specially. This type of link_order describes part of an
output section in terms of a section belonging to one of the
input files. The _bfd_final_link function should read the
contents of the section and any associated relocs, apply the
relocs to the section contents, and write out the modified
section contents. If performing a relocatable link, the
relocs themselves must also be modified and written out.

The functions _bfd_relocate_contents and
_bfd_final_link_relocate provide some general support for
performing the actual relocations, notably overflow checking.
Their arguments include information about the symbol the
relocation is against and a reloc_howto_type argument
which describes the relocation to perform. These functions
are defined in reloc.c.

The a.out function which handles reading, relocating, and
writing section contents is aout_link_input_section. The
actual relocation is done in aout_link_input_section_std
and aout_link_input_section_ext.





Wyszukiwarka

Podobne podstrony:
Torrent Details (Detailed), See the contents of a torrent online
An introduction to the Analytical Writing Section of the GRE
content management using the rational unified process?3AF83F
2008 01 The Plone Zone Content Management with Plone 3 0
content
content
Brandy Corvin Howling for the Vampire
content
content
content
content
content
content
content
2002 09 Creating Virtual Worlds with Pov Ray and the Right Front End
Using the Siemens S65 Display

więcej podobnych podstron