diff options
Diffstat (limited to 'include/elf')
-rw-r--r-- | include/elf/ChangeLog | 4 | ||||
-rw-r--r-- | include/elf/aarch64.h | 136 |
2 files changed, 128 insertions, 12 deletions
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 20ba229..673250d 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,7 @@ +2013-06-26 Yufeng Zhang <yufeng.zhang@arm.com> + + * aarch64.h: Add ELF32 reloc codes and remove fake ELF64 ones. + 2013-06-24 Maciej W. Rozycki <macro@codesourcery.com> * mips.h (ELF_ST_IS_MIPS_PLT): Respect STO_MIPS16 setting. diff --git a/include/elf/aarch64.h b/include/elf/aarch64.h index a7b86c1..4101603 100644 --- a/include/elf/aarch64.h +++ b/include/elf/aarch64.h @@ -43,7 +43,126 @@ START_RELOC_NUMBERS (elf_aarch64_reloc_type) /* Null relocations. */ RELOC_NUMBER (R_AARCH64_NONE, 0) /* No reloc */ -FAKE_RELOC (R_AARCH64_static_min, 256) +/* Basic data relocations. */ + +/* .word: (S+A) */ +RELOC_NUMBER (R_AARCH64_P32_ABS32, 1) + +/* .half: (S+A) */ +RELOC_NUMBER (R_AARCH64_P32_ABS16, 2) + +/* .word: (S+A-P) */ +RELOC_NUMBER (R_AARCH64_P32_PREL32, 3) + +/* .half: (S+A-P) */ +RELOC_NUMBER (R_AARCH64_P32_PREL16, 4) + +/* Group relocations to create a 16, 32, 48 or 64 bit + unsigned data or abs address inline. */ + +/* MOV[ZK]: ((S+A) >> 0) & 0xffff */ +RELOC_NUMBER (R_AARCH64_P32_MOVW_UABS_G0, 5) + +/* MOV[ZK]: ((S+A) >> 0) & 0xffff */ +RELOC_NUMBER (R_AARCH64_P32_MOVW_UABS_G0_NC, 6) + +/* MOV[ZK]: ((S+A) >> 16) & 0xffff */ +RELOC_NUMBER (R_AARCH64_P32_MOVW_UABS_G1, 7) + +/* Group relocations to create high part of a 16, 32, 48 or 64 bit + signed data or abs address inline. Will change instruction + to MOVN or MOVZ depending on sign of calculated value. */ + +/* MOV[ZN]: ((S+A) >> 0) & 0xffff */ +RELOC_NUMBER (R_AARCH64_P32_MOVW_SABS_G0, 8) + +/* Relocations to generate 19, 21 and 33 bit PC-relative load/store + addresses: PG(x) is (x & ~0xfff). */ + +/* LD-lit: ((S+A-P) >> 2) & 0x7ffff */ +RELOC_NUMBER (R_AARCH64_P32_LD_PREL_LO19, 9) + +/* ADR: (S+A-P) & 0x1fffff */ +RELOC_NUMBER (R_AARCH64_P32_ADR_PREL_LO21, 10) + +/* ADRH: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */ +RELOC_NUMBER (R_AARCH64_P32_ADR_PREL_PG_HI21, 11) + +/* ADD: (S+A) & 0xfff */ +RELOC_NUMBER (R_AARCH64_P32_ADD_ABS_LO12_NC, 12) + +/* LD/ST8: (S+A) & 0xfff */ +RELOC_NUMBER (R_AARCH64_P32_LDST8_ABS_LO12_NC, 13) + +/* LD/ST16: (S+A) & 0xffe */ +RELOC_NUMBER (R_AARCH64_P32_LDST16_ABS_LO12_NC, 14) + +/* LD/ST32: (S+A) & 0xffc */ +RELOC_NUMBER (R_AARCH64_P32_LDST32_ABS_LO12_NC, 15) + +/* LD/ST64: (S+A) & 0xff8 */ +RELOC_NUMBER (R_AARCH64_P32_LDST64_ABS_LO12_NC, 16) + +/* LD/ST128: (S+A) & 0xff0 */ +RELOC_NUMBER (R_AARCH64_P32_LDST128_ABS_LO12_NC, 17) + +/* Relocations for control-flow instructions. */ + +/* TBZ/NZ: ((S+A-P) >> 2) & 0x3fff. */ +RELOC_NUMBER (R_AARCH64_P32_TSTBR14, 18) + +/* B.cond: ((S+A-P) >> 2) & 0x7ffff. */ +RELOC_NUMBER (R_AARCH64_P32_CONDBR19, 19) + +/* B: ((S+A-P) >> 2) & 0x3ffffff. */ +RELOC_NUMBER (R_AARCH64_P32_JUMP26, 20) + +/* BL: ((S+A-P) >> 2) & 0x3ffffff. */ +RELOC_NUMBER (R_AARCH64_P32_CALL26, 21) + + +RELOC_NUMBER (R_AARCH64_P32_GOT_LD_PREL19, 25) +RELOC_NUMBER (R_AARCH64_P32_ADR_GOT_PAGE, 26) +RELOC_NUMBER (R_AARCH64_P32_LD32_GOT_LO12_NC, 27) + + +RELOC_NUMBER (R_AARCH64_P32_TLSGD_ADR_PAGE21, 81) +RELOC_NUMBER (R_AARCH64_P32_TLSGD_ADD_LO12_NC, 82) +RELOC_NUMBER (R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21, 103) +RELOC_NUMBER (R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC, 104) +RELOC_NUMBER (R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19, 105) +RELOC_NUMBER (R_AARCH64_P32_TLSLE_MOVW_TPREL_G1, 106) +RELOC_NUMBER (R_AARCH64_P32_TLSLE_MOVW_TPREL_G0, 107) +RELOC_NUMBER (R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC, 108) +RELOC_NUMBER (R_AARCH64_P32_TLSLE_ADD_TPREL_HI12, 109) +RELOC_NUMBER (R_AARCH64_P32_TLSLE_ADD_TPREL_LO12, 110) +RELOC_NUMBER (R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC, 111) + +RELOC_NUMBER (R_AARCH64_P32_TLSDESC_LD_PREL19, 122) +RELOC_NUMBER (R_AARCH64_P32_TLSDESC_ADR_PREL21, 123) +RELOC_NUMBER (R_AARCH64_P32_TLSDESC_ADR_PAGE21, 124) +RELOC_NUMBER (R_AARCH64_P32_TLSDESC_LD32_LO12_NC, 125) +RELOC_NUMBER (R_AARCH64_P32_TLSDESC_ADD_LO12_NC, 126) +RELOC_NUMBER (R_AARCH64_P32_TLSDESC_CALL, 127) + +/* Dynamic relocations */ + +/* Copy symbol at runtime. */ +RELOC_NUMBER (R_AARCH64_P32_COPY, 180) + +/* Create GOT entry. */ +RELOC_NUMBER (R_AARCH64_P32_GLOB_DAT, 181) + + /* Create PLT entry. */ +RELOC_NUMBER (R_AARCH64_P32_JUMP_SLOT, 182) + +/* Adjust by program base. */ +RELOC_NUMBER (R_AARCH64_P32_RELATIVE, 183) +RELOC_NUMBER (R_AARCH64_P32_TLS_DTPMOD, 184) +RELOC_NUMBER (R_AARCH64_P32_TLS_DTPREL, 185) +RELOC_NUMBER (R_AARCH64_P32_TLS_TPREL, 186) +RELOC_NUMBER (R_AARCH64_P32_TLSDESC, 187) +RELOC_NUMBER (R_AARCH64_P32_IRELATIVE, 188) RELOC_NUMBER (R_AARCH64_NULL, 256) /* No reloc */ @@ -157,9 +276,6 @@ RELOC_NUMBER (R_AARCH64_GOT_LD_PREL19, 309) RELOC_NUMBER (R_AARCH64_ADR_GOT_PAGE, 311) RELOC_NUMBER (R_AARCH64_LD64_GOT_LO12_NC, 312) -FAKE_RELOC (R_AARCH64_static_max, 313) - -FAKE_RELOC (R_AARCH64_tls_min, 512) RELOC_NUMBER (R_AARCH64_TLSGD_ADR_PAGE21, 513) RELOC_NUMBER (R_AARCH64_TLSGD_ADD_LO12_NC, 514) RELOC_NUMBER (R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, 539) @@ -175,9 +291,7 @@ RELOC_NUMBER (R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, 548) RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_HI12, 549) RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_LO12, 550) RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551) -FAKE_RELOC (R_AARCH64_tls_max, 552) -FAKE_RELOC (R_AARCH64_tlsdesc_min, 560) RELOC_NUMBER (R_AARCH64_TLSDESC_LD_PREL19, 560) RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PREL21, 561) RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PAGE21, 562) @@ -188,10 +302,8 @@ RELOC_NUMBER (R_AARCH64_TLSDESC_OFF_G0_NC, 566) RELOC_NUMBER (R_AARCH64_TLSDESC_LDR, 567) RELOC_NUMBER (R_AARCH64_TLSDESC_ADD, 568) RELOC_NUMBER (R_AARCH64_TLSDESC_CALL, 569) -FAKE_RELOC (R_AARCH64_tlsdesc_max, 570) /* Dynamic relocations */ -FAKE_RELOC (R_AARCH64_dyn_min, 1024) /* Copy symbol at runtime. */ RELOC_NUMBER (R_AARCH64_COPY, 1024) @@ -204,11 +316,11 @@ RELOC_NUMBER (R_AARCH64_JUMP_SLOT, 1026) /* Adjust by program base. */ RELOC_NUMBER (R_AARCH64_RELATIVE, 1027) -RELOC_NUMBER (R_AARCH64_TLS_DTPMOD64, 1028) -RELOC_NUMBER (R_AARCH64_TLS_DTPREL64, 1029) -RELOC_NUMBER (R_AARCH64_TLS_TPREL64, 1030) +RELOC_NUMBER (R_AARCH64_TLS_DTPMOD, 1028) +RELOC_NUMBER (R_AARCH64_TLS_DTPREL, 1029) +RELOC_NUMBER (R_AARCH64_TLS_TPREL, 1030) RELOC_NUMBER (R_AARCH64_TLSDESC, 1031) -FAKE_RELOC (R_AARCH64_dyn_max, 1032) +RELOC_NUMBER (R_AARCH64_IRELATIVE, 1032) END_RELOC_NUMBERS (R_AARCH64_end) |