GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > ELF / V1-1-2

Constituent: elfreloc     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

Synopsis

Name

elfreloc - PPC ELF file strip/relocation utility

Usage

elfreloc in_file out_file

in_file - The name of the ELF file to process.
out_file - The name of the processed output file.

Description

The elfreloc utility may be helpful in reducing the size of 32-bit ELF object file for the PPC machine type. The embedded VxWorks loader uses relocatable (type ET_REL) ELF objects. These files can contain numerous relative address relocation entries (type R_PPC_REL24) for the .text section. If these entries refer to other global functions within the same object file, they are not strictly neccessary since the relative address spacing between function objects is known at build time. For the elfreloc application to successfully strip the relative relocation entries, the following restrictions apply:

The VxWorks 5.5 loader does not tamper with the relative addressing of the .text section, so it essentially never notices that the relative relocation entries have been removed. When creating the output ELF object file, elfreloc will leave intact those relative relocation entries that refer to external, undefined symbols. The VxWorks loader still needs these entries to properly link the object file into the target system.

Once the relative relocation entries have been removed by elfreloc, it may be possible to further reduce the size of an ELF object file by using a symbol reduction utility (GNU ld and objcopy are examples). Users may have defined global symbols in mutilple modules for use at build time, but not all of those symbols are expected to be global visible in the target run time environment. Unfortuntely, the default behavior of the VxWorks host build tools is to place these global symbols in the ELF object file symbol table and then to refer to these symbols with .text relocation entries whenever they are called as a function. Because the symbol entries are tied to the relocation entries, it is not possible to delete the symbol entries even though they may not be needed on the target. With the elfreloc tool, some of these relocation entries may be deleted, freeing up the symbol table entries for later removal.

The elfreloc utility does not modify the contents of any section other than the .text and .rela.text sections, and only modifies the ELF file control structures (file header, section headers) in order to reflect the new output file's more compact size.


Generated on Tue Mar 22 23:41:11 2005 by doxygen 1.3.3