enoft Manual
TNS/E Native Object Files
eNOFT Manual—527507-005
A-16
Relocation Tables
then it must be defined with an address in this object file, and that is the address that is
used for the symbol. If the symbol is of type STB_GLOBAL then the definition of the
symbol that is used to resolve the reference might exist in this object file or in another
object file.
The process of figuring out the target address is called resolving the reference. After a
reference has been resolved, the proper way to fill in the contents of the relocation site
depends on the site's relocation type.
The relocation types that can occur in linkfiles and loadfiles are different, and the
names of the relocation table sections are different. In linkfiles, for each code or data
section named .x that contains relocation sites there is a relocation table section
named .rela.x that describes the relocation sites in that section. This also includes
relocation tables needed to describe relocation sites in the .procinfo section, the
unwind function sections, and the DWARF symbol table sections. In loadfiles there are
relocation table sections named .rela.dyn and .rela.gblzd that describe all the
relocation sites in the data segment of the loadfile. Loadfiles never have relocation
sites in the text segment. The entries in .rela.dyn are for relocation sites whose target
symbols are in .dynsym, while the entries in .rela.gblzd are for relocation sites whose
target symbols are the globalized symbols listed in .dynsym.gblzd.
The format of the relocation information is the same in all cases. The ELF section type
is SHT_RELA, and the format of a relocation table entry is the following:
typedef struct ELF64_Rela {
ELF64_Addr r_offset;
ELF64_Xword r_info;
ELF64_Xword r_addend;
}Elf64_Rela
The size of this structure is 24 bytes.
In linkfiles, relocation table entries always completely describe what needs to be filled
in at the corresponding relocation sites. So, it doesn't matter what is actually in the
operands at the relocation sites. In fact, what is there should be zero, with the
following two exceptions:
The value "-1" is filled in for relocation sites that point from DWARF information at
executable code, when they correspond to unused copies of procedures.
Relocation sites that point from one DWARF section into another, that is, giving a
section offset rather than an address, are also fixed up in linkfiles created by the linker.
For loadfiles the relocation types whose names begin R_IA_64_REL make use of the
contents of the relocation site, rather than pointing at a target symbol These relocation
table entries say that the contents of the relocation site need to be updated at runtime,
or by the -alf option of the linker, based on how much the segment pointed at by the
relocation site is rebased.
In loadfiles, the relocation sites whose targets were STB_LOCAL would only need to
be updated if the loadfile was rebased. This can happen for DLL's, but not for main










