HP eld Manual page 260

Table of Contents

Advertisement

TNS/E Native Object Files
extract the target and relocation type from the r_info fi
fi
from its two pieces:
eld
#define ELF64_R_SYM (i)
#define ELF64_R_TYPE (i)
#define ELF64_R_INFO (s,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
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
R_IA_64_NONE
R_IA_64_IMM64
R_IA_64_DIR32MSB
R_IA_64_DIR64MSB
((i) >> 32)
((i) & 0xffffffff)
(((Elf64_Xword)(s) << 32) + (Elf64_Xword)(t))
eld
Value
0x00
0x23
0x24
0x26
eld Manual—527255-009
A-18
Relocation Tables
, or reconstruct the r_info
eld
. Instead, the relocation site itself
Description
No-op.
Virtual address of a symbol
in code.
Virtual address of a data
item in data.

Advertisement

Table of Contents
loading

Table of Contents