TNS/E Native Object Files
eld Manual—527255-009
A-18
Relocation Tables
extract the target and relocation type from the r_info fi
eld
, or reconstruct the r_info
fi
eld
from its two pieces:
#define ELF64_R_SYM (i) ((i) >> 32)
#define ELF64_R_TYPE (i) ((i) & 0xffffffff)
#define ELF64_R_INFO (s,t) (((Elf64_Xword)(s) << 32) + (Elf64_Xword)(t))
The target symbol is an index into the .symtab section in the case of a linkfile, or into
the .dynsym or .dynsym.gblzd section in the case of a loadfile.
r_addend
This specifies a constant that is added to the address of the target symbol to obtain the
address that is used to fill in the relocation site.
An alternative to the Elf64_Rela relocation table structure is Elf64_Rel. The difference
is that Elf64_Rel does not contain the r_addend fi
eld
. Instead, the relocation site itself
contains the addend, to be added to the address of the target symbol. One reason that
may be given for using the Elf64_Rela structure is that it allows the addend to be larger
than the number of bits available at the relocation site. The HP NonStop operating
system prefers Elf64_Rela because it means that the process of filling in the relocation
site has less dependence on the contents of the site, so there are fewer situations in
which we need to be concerned about what happened to the relocation site if the
process of filling in relocation sites got interrupted for an unpredictable reason.
Relocation Types
The following table lists the relocation types. The ones whose names end in "MSB"
are the ones that treat the relocation site as data, where the "MSB" means that the
data is considered big endian, and there may be 32-bit and 64-bit varieties of these.
These relocation sites are not necessarily well aligned.
The linker treats all addresses internally as 64-bit quantities. When an address is
placed in a 32-bit container, the requirement is that the address must fit into 32-bits as
a signed quantity. In other words, the high order 32 bits of the address must all be the
same as the highest order bit in the lower 32 bits of the address, and then the lower 32
bits of the address are used to fill in the relocation site.
Table A-4. Relocation Types
Name
Value
Description
R_IA_64_NONE
0x00
No-op.
R_IA_64_IMM64
0x23
Virtual address of a symbol
in code.
R_IA_64_DIR32MSB
0x24
Virtual address of a data
item in data.
R_IA_64_DIR64MSB
0x26
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 ...