TNS/E Native Object Files
eld Manual—527255-009
A-17
Relocation Tables
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, i.e., 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.
In loadfiles, the elements of the .rela and .rela.gblzd sections are sorted by target
symbol index. In particular, that means that all the entries with the same target symbol
are consecutive. This includes the case of relocation types whose names begin
R_IA_64_REL, which don't have a target symbol, so that the target symbol index is 0.
r_offset
This tells the location of the relocation site. In a linkfile r_offset is the offset into the
section, as the name implies. In a loadfile r_offset tells the (preferred) virtual address
of the relocation site, so that the name r_offset is a misnomer.
In either case, depending on the relocation type, the relocation site is understood to be
either an operand of an instruction or a data item.
For a relocation site that is a data item, r_offset tells the address of the first byte in that
set of bytes. In other words, since data is big endian, it is the address of the high order
byte of the value. The relocation type tells whether the relocation site contains 4 bytes
or 8 bytes of data.
For a relocation site that is an operand of an instruction, the r_offset fi
eld
identifies
both the bundle and the instruction slot within it. If you zero out the last four bits of
r_offset then the resulting value, which is a multiple of 16, is the address of the bundle.
The value in the last four bits of r_offset must be 0, 1, or 2, to identify the instruction
slot within the bundle.
r_info
The 64-bit r_info fi
eld
combines together two different pieces of information, to tell the
target symbol and the relocation type. The low order 32 bits of the r_info fi
eld
tell the
relocation type and the high order 32 bits tell the symbol. The following #define's
Summary of Contents for eld
Page 4: ......
Page 8: ...Contents eld Manual 527255 009 iv ...
Page 12: ...What s New in This Manual eld Manual 527255 009 viii Changes to the 527255 005 Manual ...
Page 34: ...Introduction to eld eld Manual 527255 009 1 14 Example of Use ...
Page 54: ...eld Input and Output eld Manual 527255 009 2 20 Using Archives ...
Page 98: ...Other eld Processing eld Manual 527255 009 4 20 Merging Source RTDUs ...
Page 242: ...Output Listings and Error Handling eld Manual 527255 009 6 132 Glossary of Errors ...