x64: Relocation Types
The relocations that are listed in the following table are defined for x64.
Table 14-19 x64: ELF Relocation Types
Name | Value | Field | Calculation |
---|---|---|---|
|
|
None |
None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
None |
Refer to the explanation following this table. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note:
Additional relocations are available for thread-local storage references. These relocations are covered in Thread-Local Storage.The special semantics for most of these relocation types are identical to those used for x86. Some relocation types have semantics beyond simple calculation.
-
R_AMD64_GOTPCREL
-
This relocations has different semantics from the
R_AMD64_GOT32
or equivalentR_386_GOTPC
relocation. The x64 architecture provides an addressing mode that is relative to the instruction pointer. Therefore, an address can be loaded from theGOT
using a single instruction.The calculation for the
R_AMD64_GOTPCREL
relocation provides the difference between the location in theGOT
where the symbol's address is given, and the location where the relocation is applied. -
R_AMD64_32
-
The computed value is truncated to 32 bits. The link-editor verifies that the generated value for the relocation zero-extends to the original 64-bit value.
-
R_AMD64_32S
-
The computed value is truncated to 32 bits. The link-editor verifies that the generated value for the relocation sign-extends to the original 64-bit value.
-
R_AMD64_8
,R_AMD64_16
,R_AMD64_PC16
, andR_AMD64_PC8
-
These relocations are not conformant to the x64 ABI, but are added here for documentation purposes. The
R_AMD64_8
relocation truncates the computed value to 8-bits. TheR_AMD64_16
relocation truncates the computed value to 16-bits.