Module goblin::elf::reloc[][src]

Relocation computations

The following notation is used to describe relocation computations specific to x86_64 ELF.

  • A: The addend used to compute the value of the relocatable field.
  • B: The base address at which a shared object is loaded into memory during execution. Generally, a shared object file is built with a base virtual address of 0. However, the execution address of the shared object is different.
  • G: The offset into the global offset table at which the address of the relocation entry’s symbol resides during execution.
  • GOT: The address of the global offset table.
  • L: The section offset or address of the procedure linkage table entry for a symbol.
  • P: The section offset or address of the storage unit being relocated, computed using r_offset.
  • S: The value of the symbol whose index resides in the relocation entry.
  • Z: The size of the symbol whose index resides in the relocation entry.

Below are some common x86_64 relocation computations you might find useful:

RelocationValueSizeFormula
R_X86_64_NONE0NONENONE
R_X86_64_64164S + A
R_X86_64_PC32232S + A - P
R_X86_64_GOT32332G + A
R_X86_64_PLT32432L + A - P
R_X86_64_COPY5NONENONE
R_X86_64_GLOB_DAT664S
R_X86_64_JUMP_SLOT764S
R_X86_64_RELATIVE864B + A
R_X86_64_GOTPCREL932G + GOT + A - P
R_X86_64_321032S + A
R_X86_64_32S1132S + A
R_X86_64_161216S + A
R_X86_64_PC161316S + A - P
R_X86_64_8148S + A
R_X86_64_PC8158S + A - P
R_X86_64_DTPMOD641664
R_X86_64_DTPOFF641764
R_X86_64_TPOFF641864
R_X86_64_TLSGD1932
R_X86_64_TLSLD2032
R_X86_64_DTPOFF322132
R_X86_64_GOTTPOFF2232
R_X86_64_TPOFF322332
R_X86_64_PC642464S + A - P
R_X86_64_GOTOFF642564S + A - GOT
R_X86_64_GOTPC322632GOT + A - P
R_X86_64_SIZE323232Z + A
R_X86_64_SIZE643364Z + A
R_X86_64_GOTPC32_TLSDESC 3432
R_X86_64_TLSDESC_CALL35NONE
R_X86_64_TLSDESC3664 × 2
R_X86_64_IRELATIVE3764indirect (B + A)

TLS information is at http://people.redhat.com/aoliva/writeups/TLS/RFC-TLSDESC-x86.txt

R_X86_64_IRELATIVE is similar to R_X86_64_RELATIVE except that the value used in this relocation is the program address returned by the function, which takes no arguments, at the address of the result of the corresponding R_X86_64_RELATIVE relocation.

Read more https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter6-54839.html

Modules

reloc32
reloc64

Structs

Reloc

A unified ELF relocation structure

RelocIterator
RelocSection

An ELF section containing relocations, allowing lazy iteration over symbols.

Constants

R_386_8
R_386_16
R_386_32

Direct 32 bit

R_386_32PLT
R_386_COPY

Copy symbol at runtime

R_386_GLOB_DAT

Create GOT entry

R_386_GOT32

32 bit GOT entry

R_386_GOT32X

Load from 32 bit GOT entry, relaxable

R_386_GOTOFF

32 bit offset to GOT

R_386_GOTPC

32 bit PC relative offset to GOT

R_386_IRELATIVE

Adjust indirectly by program base

R_386_JMP_SLOT

Create PLT entry

R_386_NONE

No reloc

R_386_NUM

Keep this the last entry

R_386_PC8
R_386_PC16
R_386_PC32

PC relative 32 bit

R_386_PLT32

32 bit PLT address

R_386_RELATIVE

Adjust by program base

R_386_SIZE32

32-bit symbol size

R_386_TLS_DESC

TLS descriptor containing pointer to code and to argument, returning the TLS offset for the symbol

R_386_TLS_DESC_CALL

Marker of call through TLS descriptor for relaxation

R_386_TLS_DTPMOD32

ID of module containing symbol

R_386_TLS_DTPOFF32

Offset in TLS block

R_386_TLS_GD

Direct 32 bit for GNU version of general dynamic thread local data

R_386_TLS_GD_32

Direct 32 bit for general dynamic thread local data

R_386_TLS_GD_CALL

Relocation for call to __tls_get_addr()

R_386_TLS_GD_POP

Tag for popl in GD TLS code

R_386_TLS_GD_PUSH

Tag for pushl in GD TLS code

R_386_TLS_GOTDESC

GOT offset for TLS descriptor.

R_386_TLS_GOTIE

GOT entry for static TLS block offset

R_386_TLS_IE

Address of GOT entry for static TLS block offset

R_386_TLS_IE_32

GOT entry for negated static TLS block offset

R_386_TLS_LDM

Direct 32 bit for GNU version of local dynamic thread local data in LE code

R_386_TLS_LDM_32

Direct 32 bit for local dynamic thread local data in LE code

R_386_TLS_LDM_CALL

Relocation for call to __tls_get_addr() in LDM code

R_386_TLS_LDM_POP

Tag for popl in LDM TLS code

R_386_TLS_LDM_PUSH

Tag for pushl in LDM TLS code

R_386_TLS_LDO_32

Offset relative to TLS block

R_386_TLS_LE

Offset relative to static TLS block

R_386_TLS_LE_32

Negated offset relative to static TLS block

R_386_TLS_TPOFF

Offset in static TLS block

R_386_TLS_TPOFF32

Negated offset in static TLS block

R_AARCH64_ABS16

Direct 16-bit

R_AARCH64_ABS32

Direct 32 bit

R_AARCH64_ABS64

Direct 64 bit

R_AARCH64_ADD_ABS_LO12_NC

Dir. ADD imm. from bits 11:0

R_AARCH64_ADR_GOT_PAGE

P-page-rel. GOT off. ADRP 32:12

R_AARCH64_ADR_PREL_LO21

PC-rel. ADR imm. from bits 20:0

R_AARCH64_ADR_PREL_PG_HI21

Page-rel. ADRP imm. from 32:12

R_AARCH64_ADR_PREL_PG_HI21_NC

Likewise; no overflow check

R_AARCH64_CALL26

Likewise for CALL

R_AARCH64_CONDBR19

PC-rel. cond. br. imm. from 20:2.

R_AARCH64_COPY

Copy symbol at runtime

R_AARCH64_GLOB_DAT

Create GOT entry

R_AARCH64_GOTREL32

GOT-relative 32-bit

R_AARCH64_GOTREL64

GOT-relative 64-bit

R_AARCH64_GOT_LD_PREL19

PC-rel. GOT off. load imm. 20:2

R_AARCH64_IRELATIVE

STT_GNU_IFUNC relocation

R_AARCH64_JUMP26

PC-rel. B imm. from bits 27:2

R_AARCH64_JUMP_SLOT

Create PLT entry

R_AARCH64_LD64_GOTOFF_LO15

GOT-rel. off. LD/ST imm. 14:3

R_AARCH64_LD64_GOTPAGE_LO15

GOT-page-rel. GOT off. LD/ST 14:3

R_AARCH64_LD64_GOT_LO12_NC

Dir. GOT off. LD/ST imm. 11:3

R_AARCH64_LDST8_ABS_LO12_NC

Likewise for LD/ST; no check.

R_AARCH64_LDST16_ABS_LO12_NC

Dir. ADD imm. from bits 11:1

R_AARCH64_LDST32_ABS_LO12_NC

Likewise for bits 11:2

R_AARCH64_LDST64_ABS_LO12_NC

Likewise for bits 11:3

R_AARCH64_LDST128_ABS_LO12_NC

Dir. ADD imm. from bits 11:4

R_AARCH64_LD_PREL_LO19

PC-rel. LD imm. from bits 20:2

R_AARCH64_MOVW_GOTOFF_G0

GOT-rel. off. MOV{N,Z} imm. 15:0.

R_AARCH64_MOVW_GOTOFF_G0_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_GOTOFF_G1

GOT-rel. o. MOV{N,Z} imm. 31:16

R_AARCH64_MOVW_GOTOFF_G1_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_GOTOFF_G2

GOT-rel. o. MOV{N,Z} imm. 47:32

R_AARCH64_MOVW_GOTOFF_G2_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_GOTOFF_G3

GOT-rel. o. MOV{N,Z} imm. 63:48

R_AARCH64_MOVW_PREL_G0

PC-rel. MOV{N,Z} imm. from 15:0

R_AARCH64_MOVW_PREL_G0_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_PREL_G1

PC-rel. MOV{N,Z} imm. from 31:16.

R_AARCH64_MOVW_PREL_G1_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_PREL_G2

PC-rel. MOV{N,Z} imm. from 47:32.

R_AARCH64_MOVW_PREL_G2_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_PREL_G3

PC-rel. MOV{N,Z} imm. from 63:48.

R_AARCH64_MOVW_SABS_G0

Dir. MOV{N,Z} imm. from 15:0

R_AARCH64_MOVW_SABS_G1

Dir. MOV{N,Z} imm. from 31:16

R_AARCH64_MOVW_SABS_G2

Dir. MOV{N,Z} imm. from 47:32

R_AARCH64_MOVW_UABS_G0

Dir. MOVZ imm. from bits 15:0

R_AARCH64_MOVW_UABS_G0_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_UABS_G1

Dir. MOVZ imm. from bits 31:16

R_AARCH64_MOVW_UABS_G1_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_UABS_G2

Dir. MOVZ imm. from bits 47:32

R_AARCH64_MOVW_UABS_G2_NC

Likewise for MOVK; no check

R_AARCH64_MOVW_UABS_G3

Dir. MOV{K,Z} imm. from 63:48

R_AARCH64_NONE

No relocation

R_AARCH64_P32_ABS32

Direct 32 bit

R_AARCH64_P32_COPY

Copy symbol at runtime

R_AARCH64_P32_GLOB_DAT

Create GOT entry

R_AARCH64_P32_IRELATIVE

STT_GNU_IFUNC relocation

R_AARCH64_P32_JUMP_SLOT

Create PLT entry

R_AARCH64_P32_RELATIVE

Adjust by program base

R_AARCH64_P32_TLSDESC

TLS Descriptor

R_AARCH64_P32_TLS_DTPMOD

Module number, 32 bit

R_AARCH64_P32_TLS_DTPREL

Module-relative offset, 32 bit

R_AARCH64_P32_TLS_TPREL

TP-relative offset, 32 bit

R_AARCH64_PREL16

PC-relative 16-bit

R_AARCH64_PREL32

PC-relative 32-bit

R_AARCH64_PREL64

PC-relative 64-bit

R_AARCH64_RELATIVE

Adjust by program base

R_AARCH64_TLSDESC

TLS Descriptor

R_AARCH64_TLSDESC_ADD

Relax ADD

R_AARCH64_TLSDESC_ADD_LO12

Direct ADD imm. from 11:0

R_AARCH64_TLSDESC_ADR_PAGE21

Page-rel. ADRP imm. 32:12

R_AARCH64_TLSDESC_ADR_PREL21

PC-rel. ADR immediate 20:0

R_AARCH64_TLSDESC_CALL

Relax BLR

R_AARCH64_TLSDESC_LD64_LO12

Direct LD off. from 11:3

R_AARCH64_TLSDESC_LDR

Relax LDR

R_AARCH64_TLSDESC_LD_PREL19

PC-rel. load immediate 20:2

R_AARCH64_TLSDESC_OFF_G0_NC

GOT-rel. MOVK imm. 15:0; no ck

R_AARCH64_TLSDESC_OFF_G1

GOT-rel. MOV{N,Z} imm. 31:16

R_AARCH64_TLSGD_ADD_LO12_NC

direct ADD imm. from 11:0

R_AARCH64_TLSGD_ADR_PAGE21

page-rel. ADRP imm. 32:12

R_AARCH64_TLSGD_ADR_PREL21

PC-relative ADR imm. 20:0

R_AARCH64_TLSGD_MOVW_G0_NC

GOT-rel. MOVK imm. 15:0

R_AARCH64_TLSGD_MOVW_G1

GOT-rel. MOV{N,Z} 31:16

R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21

Page-rel. ADRP 32:12

R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC

Direct LD off. 11:3

R_AARCH64_TLSIE_LD_GOTTPREL_PREL19

PC-rel. load imm. 20:2

R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC

GOT-rel. MOVK 15:0

R_AARCH64_TLSIE_MOVW_GOTTPREL_G1

GOT-rel. MOV{N,Z} 31:16

R_AARCH64_TLSLD_ADD_DTPREL_HI12

DTP-rel. ADD imm. from 23:12.

R_AARCH64_TLSLD_ADD_DTPREL_LO12

DTP-rel. ADD imm. from 11:0

R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC

Likewise; no ovfl. check

R_AARCH64_TLSLD_ADD_LO12_NC

Like 514; local dynamic model

R_AARCH64_TLSLD_ADR_PAGE21

Like 513; local dynamic model

R_AARCH64_TLSLD_ADR_PREL21

Like 512; local dynamic model

R_AARCH64_TLSLD_LDST8_DTPREL_LO12

DTP-rel. LD/ST imm. 11:0

R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLD_LDST16_DTPREL_LO12

DTP-rel. LD/ST imm. 11:1

R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLD_LDST32_DTPREL_LO12

DTP-rel. LD/ST imm. 11:2

R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLD_LDST64_DTPREL_LO12

DTP-rel. LD/ST imm. 11:3

R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLD_LDST128_DTPREL_LO12

DTP-rel. LD/ST imm. 11:4.

R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLD_LD_PREL19

TLS PC-rel. load imm. 20:2

R_AARCH64_TLSLD_MOVW_DTPREL_G0

TLS DTP-rel. MOV{N,Z} 15:0

R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC

Likewise; MOVK; no check

R_AARCH64_TLSLD_MOVW_DTPREL_G1

TLS DTP-rel. MOV{N,Z} 31:16

R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC

Likewise; MOVK; no check

R_AARCH64_TLSLD_MOVW_DTPREL_G2

TLS DTP-rel. MOV{N,Z} 47:32

R_AARCH64_TLSLD_MOVW_G0_NC

Like 516; local dynamic model

R_AARCH64_TLSLD_MOVW_G1

Like 515; local dynamic model

R_AARCH64_TLSLE_ADD_TPREL_HI12

TP-rel. ADD imm. 23:12

R_AARCH64_TLSLE_ADD_TPREL_LO12

TP-rel. ADD imm. 11:0

R_AARCH64_TLSLE_ADD_TPREL_LO12_NC

Likewise; no ovfl. check

R_AARCH64_TLSLE_LDST8_TPREL_LO12

TP-rel. LD/ST off. 11:0

R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC

Likewise; no ovfl. check.

R_AARCH64_TLSLE_LDST16_TPREL_LO12

TP-rel. LD/ST off. 11:1

R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLE_LDST32_TPREL_LO12

TP-rel. LD/ST off. 11:2

R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLE_LDST64_TPREL_LO12

TP-rel. LD/ST off. 11:3

R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLE_LDST128_TPREL_LO12

TP-rel. LD/ST off. 11:4

R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC

Likewise; no check

R_AARCH64_TLSLE_MOVW_TPREL_G0

TLS TP-rel. MOV{N,Z} 15:0

R_AARCH64_TLSLE_MOVW_TPREL_G0_NC

Likewise; MOVK; no check

R_AARCH64_TLSLE_MOVW_TPREL_G1

TLS TP-rel. MOV{N,Z} 31:16

R_AARCH64_TLSLE_MOVW_TPREL_G1_NC

Likewise; MOVK; no check

R_AARCH64_TLSLE_MOVW_TPREL_G2

TLS TP-rel. MOV{N,Z} 47:32

R_AARCH64_TLS_DTPMOD

Module number, 64 bit

R_AARCH64_TLS_DTPREL

Module-relative offset, 64 bit

R_AARCH64_TLS_TPREL

TP-relative offset, 64 bit

R_AARCH64_TSTBR14

PC-rel. TBZ/TBNZ imm. from 15:2

R_ARM_ABS8

Direct 8 bit

R_ARM_ABS12

Direct 12 bit

R_ARM_ABS16

Direct 16 bit

R_ARM_ABS32

Direct 32 bit

R_ARM_ABS32_NOI

Direct 32-bit

R_ARM_ALU_PCREL_7_0

Obsolete

R_ARM_ALU_PCREL_15_8

Obsolete

R_ARM_ALU_PCREL_23_15

Obsolete

R_ARM_ALU_PC_G0

PC relative (ADD, SUB)

R_ARM_ALU_PC_G0_NC

PC relative (ADD, SUB)

R_ARM_ALU_PC_G1

PC relative (ADD, SUB)

R_ARM_ALU_PC_G1_NC

PC relative (ADD, SUB)

R_ARM_ALU_PC_G2

PC relative (ADD, SUB)

R_ARM_ALU_SBREL_19_12

Deprecated, prog. base relative

R_ARM_ALU_SBREL_27_20

Deprecated, prog. base relative

R_ARM_ALU_SB_G0

Program base relative (ADD,SUB)

R_ARM_ALU_SB_G0_NC

Program base relative (ADD,SUB)

R_ARM_ALU_SB_G1

Program base relative (ADD,SUB)

R_ARM_ALU_SB_G1_NC

Program base relative (ADD,SUB)

R_ARM_ALU_SB_G2

Program base relative (ADD,SUB)

R_ARM_AMP_VCALL9
R_ARM_BASE_ABS

Adjust by program base

R_ARM_CALL

PC relative 24 bit (BL, BLX)

R_ARM_COPY

Copy symbol at runtime

R_ARM_GLOB_DAT

Create GOT entry

R_ARM_GNU_VTENTRY
R_ARM_GNU_VTINHERIT
R_ARM_GOT32

32 bit GOT entry

R_ARM_GOTOFF

32 bit offset to GOT

R_ARM_GOTOFF12

12 bit, GOT entry relative to GOT origin (LDR, STR)

R_ARM_GOTPC

32 bit PC relative offset to GOT

R_ARM_GOTRELAX
R_ARM_GOT_ABS

GOT entry

R_ARM_GOT_BREL12

GOT entry relative to GOT origin (LDR)

R_ARM_GOT_PREL

PC relative GOT entry

R_ARM_IRELATIVE
R_ARM_JUMP24

PC relative 24 bit (B, BL)

R_ARM_JUMP_SLOT

Create PLT entry

R_ARM_LDC_PC_G0

PC relative (LDC, STC)

R_ARM_LDC_PC_G1

PC relative (LDC, STC)

R_ARM_LDC_PC_G2

PC relative (LDC, STC)

R_ARM_LDC_SB_G0

Program base relative (LDC,STC)

R_ARM_LDC_SB_G1

Program base relative (LDC,STC)

R_ARM_LDC_SB_G2

Program base relative (LDC,STC)

R_ARM_LDRS_PC_G0

PC relative (STR{D,H},LDR{D,SB,H,SH})

R_ARM_LDRS_PC_G1

PC relative (STR{D,H},LDR{D,SB,H,SH})

R_ARM_LDRS_PC_G2

PC relative (STR{D,H},LDR{D,SB,H,SH})

R_ARM_LDRS_SB_G0

Program base relative (LDR, STR, LDRB, STRB)

R_ARM_LDRS_SB_G1

Program base relative (LDR, STR, LDRB, STRB)

R_ARM_LDRS_SB_G2

Program base relative (LDR, STR, LDRB, STRB)

R_ARM_LDR_PC_G1

PC relative (LDR,STR,LDRB,STRB)

R_ARM_LDR_PC_G2

PC relative (LDR,STR,LDRB,STRB)

R_ARM_LDR_SBREL_11_0

Deprecated, prog. base relative

R_ARM_LDR_SB_G0

Program base relative (LDR,STR, LDRB, STRB)

R_ARM_LDR_SB_G1

Program base relative (LDR, STR, LDRB, STRB)

R_ARM_LDR_SB_G2

Program base relative (LDR, STR, LDRB, STRB)

R_ARM_ME_TOO

Obsolete

R_ARM_MOVT_ABS

Direct high 16-bit (MOVT)

R_ARM_MOVT_BREL

Program base relative high 16 bit (MOVT)

R_ARM_MOVT_PREL

PC relative (MOVT)

R_ARM_MOVW_ABS_NC

Direct 16-bit (MOVW)

R_ARM_MOVW_BREL

Program base relative 16 bit (MOVW)

R_ARM_MOVW_BREL_NC

Program base relative 16 bit (MOVW)

R_ARM_MOVW_PREL_NC

PC relative 16-bit (MOVW)

R_ARM_NONE

No reloc

R_ARM_NUM

Keep this the last entry

R_ARM_PC13
R_ARM_PC24

Deprecated PC relative 26 bit branch

R_ARM_PLT32

Deprecated, 32 bit PLT address

R_ARM_PLT32_ABS
R_ARM_PREL31

32 bit PC relative

R_ARM_RABS22
R_ARM_RBASE
R_ARM_REL32

PC relative 32 bit

R_ARM_REL32_NOI

PC relative 32-bit

R_ARM_RELATIVE

Adjust by program base

R_ARM_RPC24
R_ARM_RREL32
R_ARM_RSBREL32
R_ARM_RXPC25
R_ARM_SBREL31

Program base relative

R_ARM_SBREL32
R_ARM_SWI24

Obsolete static relocation

R_ARM_TARGET1
R_ARM_TARGET2
R_ARM_THM_ABS5

Direct & 0x7C (LDR, STR)

R_ARM_THM_ALU_PREL_11_0

PC relative 12 bit (Thumb32 ADR.W)

R_ARM_THM_GOT_BREL12

GOT entry relative to GOT origin, 12 bit (Thumb32 LDR)

R_ARM_THM_JUMP6

PC relative X & 0x7E (Thumb16 CBZ, CBNZ)

R_ARM_THM_JUMP19

PC relative 20 bit (Thumb32 B.W)

R_ARM_THM_JUMP24

PC relative 24 bit (Thumb32 B.W)

R_ARM_THM_MOVT_ABS

Direct high 16 bit (Thumb32 MOVT)

R_ARM_THM_MOVT_BREL

Program base relative high 16 bit (Thumb32 MOVT)

R_ARM_THM_MOVT_PREL

PC relative high 16 bit (Thumb32 MOVT)

R_ARM_THM_MOVW_ABS_NC

Direct 16 bit (Thumb32 MOVW)

R_ARM_THM_MOVW_BREL

Program base relative 16 bit (Thumb32 MOVW)

R_ARM_THM_MOVW_BREL_NC

Program base relative 16 bit (Thumb32 MOVW)

R_ARM_THM_MOVW_PREL_NC

PC relative 16 bit (Thumb32 MOVW)

R_ARM_THM_PC8

PC relative & 0x3FC(Thumb16 LDR, ADD, ADR).

R_ARM_THM_PC9

PC relative & 0x1FE (Thumb16 B/B)

R_ARM_THM_PC11

PC relative & 0xFFE (Thumb16 B)

R_ARM_THM_PC12

PC relative 12 bit (Thumb32 LDR{D,SB,H,SH})

R_ARM_THM_PC22

PC relative 24 bit (Thumb32 BL)

R_ARM_THM_RPC22
R_ARM_THM_SWI8

Reserved

R_ARM_THM_TLS_CALL
R_ARM_THM_TLS_DESCSEQ
R_ARM_THM_TLS_DESCSEQ16
R_ARM_THM_TLS_DESCSEQ32
R_ARM_THM_XPC22

Reserved

R_ARM_TLS_CALL
R_ARM_TLS_DESC

Dynamic relocation

R_ARM_TLS_DESCSEQ

TLS relaxation

R_ARM_TLS_DTPMOD32

ID of module containing symbol

R_ARM_TLS_DTPOFF32

Offset in TLS block

R_ARM_TLS_GD32

PC-rel 32 bit for global dynamic thread local data

R_ARM_TLS_GOTDESC
R_ARM_TLS_IE12GP

12 bit GOT entry relative to GOT origin (LDR)

R_ARM_TLS_IE32

PC-rel 32 bit for GOT entry of static TLS block offset

R_ARM_TLS_LDM32

PC-rel 32 bit for local dynamic thread local data

R_ARM_TLS_LDO12

12 bit relative to TLS block (LDR, STR)

R_ARM_TLS_LDO32

32 bit offset relative to TLS block

R_ARM_TLS_LE12

12 bit relative to static TLS block (LDR, STR)

R_ARM_TLS_LE32

32 bit offset relative to static TLS block

R_ARM_TLS_TPOFF32

Offset in static TLS block

R_ARM_V4BX
R_ARM_XPC25

Reserved

R_MIPS_16

Direct 16 bit

R_MIPS_26

Direct 26 bit shifted

R_MIPS_32

Direct 32 bit

R_MIPS_64
R_MIPS_ADD_IMMEDIATE
R_MIPS_CALL16

16 bit GOT entry for function

R_MIPS_CALL_HI16
R_MIPS_CALL_LO16
R_MIPS_COPY
R_MIPS_DELETE
R_MIPS_GLOB_DAT
R_MIPS_GOT16

16 bit GOT entry

R_MIPS_GOT_DISP
R_MIPS_GOT_HI16
R_MIPS_GOT_LO16
R_MIPS_GOT_OFST
R_MIPS_GOT_PAGE
R_MIPS_GPREL16

GP relative 16 bit

R_MIPS_GPREL32

GP relative 32 bit

R_MIPS_HI16

High 16 bit

R_MIPS_HIGHER
R_MIPS_HIGHEST
R_MIPS_INSERT_A
R_MIPS_INSERT_B
R_MIPS_JALR
R_MIPS_JUMP_SLOT
R_MIPS_LITERAL

16 bit literal entry

R_MIPS_LO16

Low 16 bit

R_MIPS_NONE

No reloc

R_MIPS_NUM
R_MIPS_PC16

PC relative 16 bit

R_MIPS_PJUMP
R_MIPS_REL16
R_MIPS_REL32

PC relative 32 bit

R_MIPS_RELGOT
R_MIPS_SCN_DISP
R_MIPS_SHIFT5
R_MIPS_SHIFT6
R_MIPS_SUB
R_MIPS_TLS_DTPMOD32

Module number 32 bit

R_MIPS_TLS_DTPMOD64

Module number 64 bit

R_MIPS_TLS_DTPREL32

Module-relative offset 32 bit

R_MIPS_TLS_DTPREL64

Module-relative offset 64 bit

R_MIPS_TLS_DTPREL_HI16

Module-relative offset, high 16 bits

R_MIPS_TLS_DTPREL_LO16

Module-relative offset, low 16 bits

R_MIPS_TLS_GD

16 bit GOT offset for GD

R_MIPS_TLS_GOTTPREL

16 bit GOT offset for IE

R_MIPS_TLS_LDM

16 bit GOT offset for LDM

R_MIPS_TLS_TPREL32

TP-relative offset, 32 bit6

R_MIPS_TLS_TPREL64

TP-relative offset, 64 bit

R_MIPS_TLS_TPREL_HI16

TP-relative offset, high 16 bits

R_MIPS_TLS_TPREL_LO16

TP-relative offset, low 16 bits

R_OR1K_8
R_OR1K_8_PCREL
R_OR1K_16
R_OR1K_16_PCREL
R_OR1K_32
R_OR1K_32_PCREL
R_OR1K_COPY
R_OR1K_GLOB_DAT
R_OR1K_GNU_VTENTRY
R_OR1K_GNU_VTINHERIT
R_OR1K_GOT16
R_OR1K_GOTOFF_HI16
R_OR1K_GOTOFF_LO16
R_OR1K_GOTPC_HI16
R_OR1K_GOTPC_LO16
R_OR1K_HI_16_IN_INSN
R_OR1K_INSN_REL_26
R_OR1K_JMP_SLOT
R_OR1K_LO_16_IN_INSN
R_OR1K_NONE
R_OR1K_NUM
R_OR1K_PLT26
R_OR1K_RELATIVE
R_OR1K_TLS_DTPMOD
R_OR1K_TLS_DTPOFF
R_OR1K_TLS_GD_HI16
R_OR1K_TLS_GD_LO16
R_OR1K_TLS_IE_HI16
R_OR1K_TLS_IE_LO16
R_OR1K_TLS_LDM_HI16
R_OR1K_TLS_LDM_LO16
R_OR1K_TLS_LDO_HI16
R_OR1K_TLS_LDO_LO16
R_OR1K_TLS_LE_HI16
R_OR1K_TLS_LE_LO16
R_OR1K_TLS_TPOFF
R_RISCV_32

Runtime relocation: word32 = S + A

R_RISCV_64

Runtime relocation: word64 = S + A

R_RISCV_ADD8

8-bit label addition: word8 = S + A

R_RISCV_ADD16

16-bit label addition: word16 = S + A

R_RISCV_ADD32

32-bit label addition: word32 = S + A

R_RISCV_ADD64

64-bit label addition: word64 = S + A

R_RISCV_ALIGN

Alignment statement

R_RISCV_BRANCH

PC-relative branch (SB-Type)

R_RISCV_CALL

PC-relative call: MACRO call,tail (auipc+jalr pair)

R_RISCV_CALL_PLT

PC-relative call (PLT): MACRO call,tail (auipc+jalr pair) PIC

R_RISCV_COPY

Runtime relocation: must be in executable, not allowed in shared library

R_RISCV_GNU_VTENTRY

GNU C++ vtable member usage

R_RISCV_GNU_VTINHERIT

GNU C++ vtable hierarchy

R_RISCV_GOT_HI20

PC-relative GOT reference: MACRO la

R_RISCV_GPREL_I

GP-relative reference (I-Type)

R_RISCV_GPREL_S

GP-relative reference (S-Type)

R_RISCV_HI20

Absolute address: %hi(symbol) (U-Type)

R_RISCV_JAL

PC-relative jump (UJ-Type)

R_RISCV_JUMP_SLOT

Runtime relocation: word32,64 = S; handled by PLT unless LD_BIND_NOW

R_RISCV_LO12_I

Absolute address: %lo(symbol) (I-Type)

R_RISCV_LO12_S

Absolute address: %lo(symbol) (S-Type)

R_RISCV_NONE

None

R_RISCV_PCREL_HI20

PC-relative reference: %pcrel_hi(symbol) (U-Type)

R_RISCV_PCREL_LO12_I

PC-relative reference: %pcrel_lo(symbol) (I-Type)

R_RISCV_PCREL_LO12_S

PC-relative reference: %pcrel_lo(symbol) (S-Type)

R_RISCV_RELATIVE

Runtime relocation: word32,64 = B + A

R_RISCV_RELAX

Instruction pair can be relaxed

R_RISCV_RVC_BRANCH

PC-relative branch offset (CB-Type)

R_RISCV_RVC_JUMP

PC-relative jump offset (CJ-Type)

R_RISCV_RVC_LUI

Absolute address (CI-Type)

R_RISCV_SET6

Local label subtraction

R_RISCV_SET8

Local label subtraction

R_RISCV_SET16

Local label subtraction

R_RISCV_SET32

Local label subtraction

R_RISCV_SUB6

Local label subtraction

R_RISCV_SUB8

8-bit label subtraction: word8 = S - A

R_RISCV_SUB16

16-bit label subtraction: word16 = S - A

R_RISCV_SUB32

32-bit label subtraction: word32 = S - A

R_RISCV_SUB64

64-bit label subtraction: word64 = S - A

R_RISCV_TLS_DTPMOD32

TLS relocation: word32 = S->TLSINDEX

R_RISCV_TLS_DTPMOD64

TLS relocation: word64 = S->TLSINDEX

R_RISCV_TLS_DTPREL32

TLS relocation: word32 = TLS + S + A - TLS_TP_OFFSET

R_RISCV_TLS_DTPREL64

TLS relocation: word64 = TLS + S + A - TLS_TP_OFFSET

R_RISCV_TLS_GD_HI20

PC-relative TLS GD reference: MACRO la.tls.gd

R_RISCV_TLS_GOT_HI20

PC-relative TLS IE GOT offset: MACRO la.tls.ie

R_RISCV_TLS_TPREL32

TLS relocation: word32 = TLS + S + A + S_TLS_OFFSET - TLS_DTV_OFFSET

R_RISCV_TLS_TPREL64

TLS relocation: word64 = TLS + S + A + S_TLS_OFFSET - TLS_DTV_OFFSET

R_RISCV_TPREL_ADD

TLS LE thread usage: %tprel_add(symbol)

R_RISCV_TPREL_HI20

TLS LE thread offset: %tprel_hi(symbol) (U-Type)

R_RISCV_TPREL_I

TP-relative TLS LE load (I-Type)

R_RISCV_TPREL_LO12_I

TLS LE thread offset: %tprel_lo(symbol) (I-Type)

R_RISCV_TPREL_LO12_S

TLS LE thread offset: %tprel_lo(symbol) (S-Type)

R_RISCV_TPREL_S

TP-relative TLS LE store (S-Type)

R_X86_64_8

Direct 8 bit sign extended.

R_X86_64_16

Direct 16 bit zero extended.

R_X86_64_32

Direct 32 bit zero extended.

R_X86_64_32S

Direct 32 bit sign extended.

R_X86_64_64

Direct 64 bit.

R_X86_64_COPY

Copy symbol at runtime.

R_X86_64_DTPMOD64

ID of module containing symbol.

R_X86_64_DTPOFF32

Offset in TLS block.

R_X86_64_DTPOFF64

Offset in module’s TLS block.

R_X86_64_GLOB_DAT

Create GOT entry.

R_X86_64_GOT32

32 bit GOT entry.

R_X86_64_GOT64

64-bit GOT entry offset.

R_X86_64_GOTOFF64

64 bit offset to GOT.

R_X86_64_GOTPC32

32 bit signed pc relative offset to GOT.

R_X86_64_GOTPC32_TLSDESC

GOT offset for TLS descriptor..

R_X86_64_GOTPC64

64-bit PC relative offset to GOT.

R_X86_64_GOTPCREL

32 bit signed PC relative offset to GOT.

R_X86_64_GOTPCREL64

64-bit PC relative offset to GOT entry.

R_X86_64_GOTPCRELX

Load from 32 bit signed pc relative offset to GOT entry without REX prefix, relaxable.

R_X86_64_GOTPLT64

like GOT64, says PLT entry needed.

R_X86_64_GOTTPOFF

32 bit signed PC relative offset to GOT entry for IE symbol.

R_X86_64_IRELATIVE

Adjust indirectly by program base.

R_X86_64_JUMP_SLOT

Create PLT entry.

R_X86_64_NONE

No reloc.

R_X86_64_NUM
R_X86_64_PC8

8 bit sign extended pc relative.

R_X86_64_PC16

16 bit sign extended pc relative.

R_X86_64_PC32

PC relative 32 bit signed.

R_X86_64_PC64

PC relative 64 bit.

R_X86_64_PLT32

32 bit PLT address.

R_X86_64_PLTOFF64

64-bit GOT relative offset to PLT entry.

R_X86_64_RELATIVE

Adjust by program base.

R_X86_64_RELATIVE64

64-bit adjust by program base.

R_X86_64_REX_GOTPCRELX

Load from 32 bit signed pc relative offset to GOT entry with REX prefix, relaxable.

R_X86_64_SIZE32

Size of symbol plus 32-bit addend.

R_X86_64_SIZE64

Size of symbol plus 64-bit addend.

R_X86_64_TLSDESC

TLS descriptor..

R_X86_64_TLSDESC_CALL

Marker for call through TLS descriptor..

R_X86_64_TLSGD

32 bit signed PC relative offset to two GOT entries for GD symbol.

R_X86_64_TLSLD

32 bit signed PC relative offset to two GOT entries for LD symbol.

R_X86_64_TPOFF32

Offset in initial TLS block.

R_X86_64_TPOFF64

Offset in initial TLS block.

Functions

r_to_str