226 lines
13 KiB
Modula-2
226 lines
13 KiB
Modula-2
|
|
#ifndef ELF_RELOC
|
|
#error "ELF_RELOC must be defined"
|
|
#endif
|
|
|
|
// Based on ABI release 1.1-beta, dated 6 November 2013. NB: The cover page of
|
|
// this document, IHI0056C_beta_aaelf64.pdf, on infocenter.arm.com, still
|
|
// labels this as release 1.0.
|
|
ELF_RELOC(R_AARCH64_NONE, 0)
|
|
ELF_RELOC(R_AARCH64_ABS64, 0x101)
|
|
ELF_RELOC(R_AARCH64_ABS32, 0x102)
|
|
ELF_RELOC(R_AARCH64_ABS16, 0x103)
|
|
ELF_RELOC(R_AARCH64_PREL64, 0x104)
|
|
ELF_RELOC(R_AARCH64_PREL32, 0x105)
|
|
ELF_RELOC(R_AARCH64_PREL16, 0x106)
|
|
ELF_RELOC(R_AARCH64_MOVW_UABS_G0, 0x107)
|
|
ELF_RELOC(R_AARCH64_MOVW_UABS_G0_NC, 0x108)
|
|
ELF_RELOC(R_AARCH64_MOVW_UABS_G1, 0x109)
|
|
ELF_RELOC(R_AARCH64_MOVW_UABS_G1_NC, 0x10a)
|
|
ELF_RELOC(R_AARCH64_MOVW_UABS_G2, 0x10b)
|
|
ELF_RELOC(R_AARCH64_MOVW_UABS_G2_NC, 0x10c)
|
|
ELF_RELOC(R_AARCH64_MOVW_UABS_G3, 0x10d)
|
|
ELF_RELOC(R_AARCH64_MOVW_SABS_G0, 0x10e)
|
|
ELF_RELOC(R_AARCH64_MOVW_SABS_G1, 0x10f)
|
|
ELF_RELOC(R_AARCH64_MOVW_SABS_G2, 0x110)
|
|
ELF_RELOC(R_AARCH64_LD_PREL_LO19, 0x111)
|
|
ELF_RELOC(R_AARCH64_ADR_PREL_LO21, 0x112)
|
|
ELF_RELOC(R_AARCH64_ADR_PREL_PG_HI21, 0x113)
|
|
ELF_RELOC(R_AARCH64_ADR_PREL_PG_HI21_NC, 0x114)
|
|
ELF_RELOC(R_AARCH64_ADD_ABS_LO12_NC, 0x115)
|
|
ELF_RELOC(R_AARCH64_LDST8_ABS_LO12_NC, 0x116)
|
|
ELF_RELOC(R_AARCH64_TSTBR14, 0x117)
|
|
ELF_RELOC(R_AARCH64_CONDBR19, 0x118)
|
|
ELF_RELOC(R_AARCH64_JUMP26, 0x11a)
|
|
ELF_RELOC(R_AARCH64_CALL26, 0x11b)
|
|
ELF_RELOC(R_AARCH64_LDST16_ABS_LO12_NC, 0x11c)
|
|
ELF_RELOC(R_AARCH64_LDST32_ABS_LO12_NC, 0x11d)
|
|
ELF_RELOC(R_AARCH64_LDST64_ABS_LO12_NC, 0x11e)
|
|
ELF_RELOC(R_AARCH64_MOVW_PREL_G0, 0x11f)
|
|
ELF_RELOC(R_AARCH64_MOVW_PREL_G0_NC, 0x120)
|
|
ELF_RELOC(R_AARCH64_MOVW_PREL_G1, 0x121)
|
|
ELF_RELOC(R_AARCH64_MOVW_PREL_G1_NC, 0x122)
|
|
ELF_RELOC(R_AARCH64_MOVW_PREL_G2, 0x123)
|
|
ELF_RELOC(R_AARCH64_MOVW_PREL_G2_NC, 0x124)
|
|
ELF_RELOC(R_AARCH64_MOVW_PREL_G3, 0x125)
|
|
ELF_RELOC(R_AARCH64_LDST128_ABS_LO12_NC, 0x12b)
|
|
ELF_RELOC(R_AARCH64_MOVW_GOTOFF_G0, 0x12c)
|
|
ELF_RELOC(R_AARCH64_MOVW_GOTOFF_G0_NC, 0x12d)
|
|
ELF_RELOC(R_AARCH64_MOVW_GOTOFF_G1, 0x12e)
|
|
ELF_RELOC(R_AARCH64_MOVW_GOTOFF_G1_NC, 0x12f)
|
|
ELF_RELOC(R_AARCH64_MOVW_GOTOFF_G2, 0x130)
|
|
ELF_RELOC(R_AARCH64_MOVW_GOTOFF_G2_NC, 0x131)
|
|
ELF_RELOC(R_AARCH64_MOVW_GOTOFF_G3, 0x132)
|
|
ELF_RELOC(R_AARCH64_GOTREL64, 0x133)
|
|
ELF_RELOC(R_AARCH64_GOTREL32, 0x134)
|
|
ELF_RELOC(R_AARCH64_GOT_LD_PREL19, 0x135)
|
|
ELF_RELOC(R_AARCH64_LD64_GOTOFF_LO15, 0x136)
|
|
ELF_RELOC(R_AARCH64_ADR_GOT_PAGE, 0x137)
|
|
ELF_RELOC(R_AARCH64_LD64_GOT_LO12_NC, 0x138)
|
|
ELF_RELOC(R_AARCH64_LD64_GOTPAGE_LO15, 0x139)
|
|
ELF_RELOC(R_AARCH64_PLT32, 0x13a)
|
|
ELF_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 0x200)
|
|
ELF_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 0x201)
|
|
ELF_RELOC(R_AARCH64_TLSGD_ADD_LO12_NC, 0x202)
|
|
ELF_RELOC(R_AARCH64_TLSGD_MOVW_G1, 0x203)
|
|
ELF_RELOC(R_AARCH64_TLSGD_MOVW_G0_NC, 0x204)
|
|
ELF_RELOC(R_AARCH64_TLSLD_ADR_PREL21, 0x205)
|
|
ELF_RELOC(R_AARCH64_TLSLD_ADR_PAGE21, 0x206)
|
|
ELF_RELOC(R_AARCH64_TLSLD_ADD_LO12_NC, 0x207)
|
|
ELF_RELOC(R_AARCH64_TLSLD_MOVW_G1, 0x208)
|
|
ELF_RELOC(R_AARCH64_TLSLD_MOVW_G0_NC, 0x209)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LD_PREL19, 0x20a)
|
|
ELF_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G2, 0x20b)
|
|
ELF_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1, 0x20c)
|
|
ELF_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, 0x20d)
|
|
ELF_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0, 0x20e)
|
|
ELF_RELOC(R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, 0x20f)
|
|
ELF_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_HI12, 0x210)
|
|
ELF_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_LO12, 0x211)
|
|
ELF_RELOC(R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, 0x212)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12, 0x213)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, 0x214)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12, 0x215)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, 0x216)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12, 0x217)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, 0x218)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12, 0x219)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, 0x21a)
|
|
ELF_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, 0x21b)
|
|
ELF_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 0x21c)
|
|
ELF_RELOC(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 0x21d)
|
|
ELF_RELOC(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 0x21e)
|
|
ELF_RELOC(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 0x21f)
|
|
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G2, 0x220)
|
|
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1, 0x221)
|
|
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 0x222)
|
|
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0, 0x223)
|
|
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, 0x224)
|
|
ELF_RELOC(R_AARCH64_TLSLE_ADD_TPREL_HI12, 0x225)
|
|
ELF_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12, 0x226)
|
|
ELF_RELOC(R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 0x227)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12, 0x228)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, 0x229)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12, 0x22a)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, 0x22b)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12, 0x22c)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 0x22d)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12, 0x22e)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 0x22f)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_LD_PREL19, 0x230)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_ADR_PREL21, 0x231)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_ADR_PAGE21, 0x232)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_LD64_LO12, 0x233)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_ADD_LO12, 0x234)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_OFF_G1, 0x235)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_OFF_G0_NC, 0x236)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_LDR, 0x237)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_ADD, 0x238)
|
|
ELF_RELOC(R_AARCH64_TLSDESC_CALL, 0x239)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12, 0x23a)
|
|
ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 0x23b)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 0x23c)
|
|
ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 0x23d)
|
|
// Dynamic relocations start
|
|
ELF_RELOC(R_AARCH64_COPY, 0x400)
|
|
ELF_RELOC(R_AARCH64_GLOB_DAT, 0x401)
|
|
ELF_RELOC(R_AARCH64_JUMP_SLOT, 0x402)
|
|
ELF_RELOC(R_AARCH64_RELATIVE, 0x403)
|
|
// 0x404 and 0x405 are now R_AARCH64_TLS_IMPDEF1 and R_AARCH64_TLS_IMPDEF2
|
|
// We follow GNU and define TLS_IMPDEF1 as TLS_DTPMOD64 and TLS_IMPDEF2 as
|
|
// TLS_DTPREL64
|
|
ELF_RELOC(R_AARCH64_TLS_DTPMOD64, 0x404)
|
|
ELF_RELOC(R_AARCH64_TLS_DTPREL64, 0x405)
|
|
ELF_RELOC(R_AARCH64_TLS_TPREL64, 0x406)
|
|
ELF_RELOC(R_AARCH64_TLSDESC, 0x407)
|
|
ELF_RELOC(R_AARCH64_IRELATIVE, 0x408)
|
|
|
|
// ELF_RELOC(R_AARCH64_P32_NONE, 0)
|
|
ELF_RELOC(R_AARCH64_P32_ABS32, 0x001)
|
|
ELF_RELOC(R_AARCH64_P32_ABS16, 0x002)
|
|
ELF_RELOC(R_AARCH64_P32_PREL32, 0x003)
|
|
ELF_RELOC(R_AARCH64_P32_PREL16, 0x004)
|
|
ELF_RELOC(R_AARCH64_P32_MOVW_UABS_G0, 0x005)
|
|
ELF_RELOC(R_AARCH64_P32_MOVW_UABS_G0_NC, 0x006)
|
|
ELF_RELOC(R_AARCH64_P32_MOVW_UABS_G1, 0x007)
|
|
ELF_RELOC(R_AARCH64_P32_MOVW_SABS_G0, 0x008)
|
|
ELF_RELOC(R_AARCH64_P32_LD_PREL_LO19, 0x009)
|
|
ELF_RELOC(R_AARCH64_P32_ADR_PREL_LO21, 0x00a)
|
|
ELF_RELOC(R_AARCH64_P32_ADR_PREL_PG_HI21, 0x00b)
|
|
ELF_RELOC(R_AARCH64_P32_ADD_ABS_LO12_NC, 0x00c)
|
|
ELF_RELOC(R_AARCH64_P32_LDST8_ABS_LO12_NC, 0x00d)
|
|
ELF_RELOC(R_AARCH64_P32_LDST16_ABS_LO12_NC, 0x00e)
|
|
ELF_RELOC(R_AARCH64_P32_LDST32_ABS_LO12_NC, 0x00f)
|
|
ELF_RELOC(R_AARCH64_P32_LDST64_ABS_LO12_NC, 0x010)
|
|
ELF_RELOC(R_AARCH64_P32_LDST128_ABS_LO12_NC, 0x011)
|
|
ELF_RELOC(R_AARCH64_P32_TSTBR14, 0x012)
|
|
ELF_RELOC(R_AARCH64_P32_CONDBR19, 0x013)
|
|
ELF_RELOC(R_AARCH64_P32_JUMP26, 0x014)
|
|
ELF_RELOC(R_AARCH64_P32_CALL26, 0x015)
|
|
ELF_RELOC(R_AARCH64_P32_MOVW_PREL_G0, 0x016)
|
|
ELF_RELOC(R_AARCH64_P32_MOVW_PREL_G0_NC, 0x017)
|
|
ELF_RELOC(R_AARCH64_P32_MOVW_PREL_G1, 0x018)
|
|
ELF_RELOC(R_AARCH64_P32_GOT_LD_PREL19, 0x019)
|
|
ELF_RELOC(R_AARCH64_P32_ADR_GOT_PAGE, 0x01a)
|
|
ELF_RELOC(R_AARCH64_P32_LD32_GOT_LO12_NC, 0x01b)
|
|
ELF_RELOC(R_AARCH64_P32_LD32_GOTPAGE_LO14, 0x01c)
|
|
ELF_RELOC(R_AARCH64_P32_PLT32, 0x01d)
|
|
ELF_RELOC(R_AARCH64_P32_TLSGD_ADR_PREL21, 0x050)
|
|
ELF_RELOC(R_AARCH64_P32_TLSGD_ADR_PAGE21, 0x051)
|
|
ELF_RELOC(R_AARCH64_P32_TLSGD_ADD_LO12_NC, 0x052)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_ADR_PREL21, 0x053)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_ADR_PAGE21, 0x054)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_ADD_LO12_NC, 0x055)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LD_PREL19, 0x056)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_MOVW_DTPREL_G1, 0x057)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_MOVW_DTPREL_G0, 0x058)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_MOVW_DTPREL_G0_NC, 0x059)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_ADD_DTPREL_HI12, 0x05a)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12, 0x05b)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12_NC, 0x05c)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST8_DTPREL_LO12, 0x05d)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST8_DTPREL_LO12_NC, 0x05e)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST16_DTPREL_LO12, 0x05f)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST16_DTPREL_LO12_NC, 0x060)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST32_DTPREL_LO12, 0x061)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST32_DTPREL_LO12_NC, 0x062)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST64_DTPREL_LO12, 0x063)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST64_DTPREL_LO12_NC, 0x064)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST128_DTPREL_LO12, 0x065)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLD_LDST128_DTPREL_LO12_NC,0x066)
|
|
ELF_RELOC(R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21, 0x067)
|
|
ELF_RELOC(R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC, 0x068)
|
|
ELF_RELOC(R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19, 0x069)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_MOVW_TPREL_G1, 0x06a)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_MOVW_TPREL_G0, 0x06b)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC, 0x06c)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_ADD_TPREL_HI12, 0x06d)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_ADD_TPREL_LO12, 0x06e)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC, 0x06f)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST8_TPREL_LO12, 0x070)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST8_TPREL_LO12_NC, 0x071)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST16_TPREL_LO12, 0x072)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST16_TPREL_LO12_NC, 0x073)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST32_TPREL_LO12, 0x074)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST32_TPREL_LO12_NC, 0x075)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST64_TPREL_LO12, 0x076)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST64_TPREL_LO12_NC, 0x077)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST128_TPREL_LO12, 0x078)
|
|
ELF_RELOC(R_AARCH64_P32_TLSLE_LDST128_TPREL_LO12_NC, 0x079)
|
|
ELF_RELOC(R_AARCH64_P32_TLSDESC_LD_PREL19, 0x07a)
|
|
ELF_RELOC(R_AARCH64_P32_TLSDESC_ADR_PREL21, 0x07b)
|
|
ELF_RELOC(R_AARCH64_P32_TLSDESC_ADR_PAGE21, 0x07c)
|
|
ELF_RELOC(R_AARCH64_P32_TLSDESC_LD32_LO12, 0x07d)
|
|
ELF_RELOC(R_AARCH64_P32_TLSDESC_ADD_LO12, 0x07e)
|
|
ELF_RELOC(R_AARCH64_P32_TLSDESC_CALL, 0x07f)
|
|
// Dynamic relocations start
|
|
ELF_RELOC(R_AARCH64_P32_COPY, 0x0b4)
|
|
ELF_RELOC(R_AARCH64_P32_GLOB_DAT, 0x0b5)
|
|
ELF_RELOC(R_AARCH64_P32_JUMP_SLOT, 0x0b6)
|
|
ELF_RELOC(R_AARCH64_P32_RELATIVE, 0x0b7)
|
|
ELF_RELOC(R_AARCH64_P32_TLS_DTPREL, 0x0b8)
|
|
ELF_RELOC(R_AARCH64_P32_TLS_DTPMOD, 0x0b9)
|
|
ELF_RELOC(R_AARCH64_P32_TLS_TPREL, 0x0ba)
|
|
ELF_RELOC(R_AARCH64_P32_TLSDESC, 0x0bb)
|
|
ELF_RELOC(R_AARCH64_P32_IRELATIVE, 0x0bc)
|