32-bit x86: Relocation Types
The relocations that are listed in the following table are defined for 32-bit x86.
Table 14-18 32-bit x86: 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.Some relocation types have semantics beyond simple calculation.
-
R_386_GOT32
-
Computes the distance from the base of the
GOT
to the symbol'sGOT
entry. The relocation also instructs the link-editor to create a global offset table. -
R_386_PLT32
-
Computes the address of the symbol's procedure linkage table entry and instructs the link-editor to create a procedure linkage table.
-
R_386_COPY
-
Created by the link-editor for dynamic executables to preserve a read-only text segment. The relocation offset member refers to a location in a writable segment. The symbol table index specifies a symbol that should exist both in the current object file and in a shared object. During execution, the runtime linker copies data associated with the shared object's symbol to the location specified by the offset. See Copy Relocations.
-
R_386_GLOB_DAT
-
Used to set a
GOT
entry to the address of the specified symbol. The special relocation type enable you to determine the correspondence between symbols andGOT
entries. -
R_386_JMP_SLOT
-
Created by the link-editor for dynamic objects to provide lazy binding. The relocation offset member gives the location of a procedure linkage table entry. The runtime linker modifies the procedure linkage table entry to transfer control to the designated symbol address.
-
R_386_RELATIVE
-
Created by the link-editor for dynamic objects. The relocation offset member gives the location within a shared object that contains a value representing a relative address. The runtime linker computes the corresponding virtual address by adding the virtual address at which the shared object is loaded to the relative address. Relocation entries for this type must specify a value of zero for the symbol table index.
-
R_386_GOTOFF
-
Computes the difference between a symbol's value and the address of the
GOT
. The relocation also instructs the link-editor to create the global offset table. -
R_386_GOTPC
-
Resembles
R_386_PC32
, except that it uses the address of theGOT
in its calculation. The symbol referenced in this relocation normally is_GLOBAL_OFFSET_TABLE_
, which also instructs the link-editor to create the global offset table.