Skip to content

Commit 918542d

Browse files
authored
ELFRelocs/AArch64: update canonical reference URL (NFC) (#86955)
Update the URL of the reference to be used for AArch64.def, and add some comments. The canonical aaelf64 document can be found at: https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst
1 parent ed5fe66 commit 918542d

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
21
#ifndef ELF_RELOC
32
#error "ELF_RELOC must be defined"
43
#endif
54

6-
// Based on ABI release 1.1-beta, dated 6 November 2013. NB: The cover page of
7-
// this document, IHI0056C_beta_aaelf64.pdf, on infocenter.arm.com, still
8-
// labels this as release 1.0.
5+
// Based on released ABI: https://github.com/ARM-software/abi-aa, aaelf64.
6+
// ELF64
7+
// Null relocation: also 0x100 for ELF64
98
ELF_RELOC(R_AARCH64_NONE, 0)
9+
// Data relocations
1010
ELF_RELOC(R_AARCH64_ABS64, 0x101)
1111
ELF_RELOC(R_AARCH64_ABS32, 0x102)
1212
ELF_RELOC(R_AARCH64_ABS16, 0x103)
1313
ELF_RELOC(R_AARCH64_PREL64, 0x104)
1414
ELF_RELOC(R_AARCH64_PREL32, 0x105)
1515
ELF_RELOC(R_AARCH64_PREL16, 0x106)
16+
// Static AArch64 relocations
1617
ELF_RELOC(R_AARCH64_MOVW_UABS_G0, 0x107)
1718
ELF_RELOC(R_AARCH64_MOVW_UABS_G0_NC, 0x108)
1819
ELF_RELOC(R_AARCH64_MOVW_UABS_G1, 0x109)
@@ -60,11 +61,13 @@ ELF_RELOC(R_AARCH64_LD64_GOT_LO12_NC, 0x138)
6061
ELF_RELOC(R_AARCH64_LD64_GOTPAGE_LO15, 0x139)
6162
ELF_RELOC(R_AARCH64_PLT32, 0x13a)
6263
ELF_RELOC(R_AARCH64_GOTPCREL32, 0x13b)
64+
// General dynamic TLS relocations
6365
ELF_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 0x200)
6466
ELF_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 0x201)
6567
ELF_RELOC(R_AARCH64_TLSGD_ADD_LO12_NC, 0x202)
6668
ELF_RELOC(R_AARCH64_TLSGD_MOVW_G1, 0x203)
6769
ELF_RELOC(R_AARCH64_TLSGD_MOVW_G0_NC, 0x204)
70+
// Local dynamic TLS relocations
6871
ELF_RELOC(R_AARCH64_TLSLD_ADR_PREL21, 0x205)
6972
ELF_RELOC(R_AARCH64_TLSLD_ADR_PAGE21, 0x206)
7073
ELF_RELOC(R_AARCH64_TLSLD_ADD_LO12_NC, 0x207)
@@ -92,6 +95,7 @@ ELF_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 0x21c)
9295
ELF_RELOC(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 0x21d)
9396
ELF_RELOC(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 0x21e)
9497
ELF_RELOC(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 0x21f)
98+
// Local exec TLS relocations
9599
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G2, 0x220)
96100
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1, 0x221)
97101
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 0x222)
@@ -108,6 +112,7 @@ ELF_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12, 0x22c)
108112
ELF_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 0x22d)
109113
ELF_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12, 0x22e)
110114
ELF_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 0x22f)
115+
// TLS descriptor relocations
111116
ELF_RELOC(R_AARCH64_TLSDESC_LD_PREL19, 0x230)
112117
ELF_RELOC(R_AARCH64_TLSDESC_ADR_PREL21, 0x231)
113118
ELF_RELOC(R_AARCH64_TLSDESC_ADR_PAGE21, 0x232)
@@ -122,8 +127,7 @@ ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12, 0x23a)
122127
ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 0x23b)
123128
ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 0x23c)
124129
ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 0x23d)
125-
ELF_RELOC(R_AARCH64_AUTH_ABS64, 0x244)
126-
// Dynamic relocations start
130+
// Dynamic relocations
127131
ELF_RELOC(R_AARCH64_COPY, 0x400)
128132
ELF_RELOC(R_AARCH64_GLOB_DAT, 0x401)
129133
ELF_RELOC(R_AARCH64_JUMP_SLOT, 0x402)
@@ -136,8 +140,12 @@ ELF_RELOC(R_AARCH64_TLS_DTPREL64, 0x405)
136140
ELF_RELOC(R_AARCH64_TLS_TPREL64, 0x406)
137141
ELF_RELOC(R_AARCH64_TLSDESC, 0x407)
138142
ELF_RELOC(R_AARCH64_IRELATIVE, 0x408)
143+
// PAuthABI static and dynamic relocations: defined in pauthabielf64,
144+
// https://github.com/ARM-software/abi-aa
145+
ELF_RELOC(R_AARCH64_AUTH_ABS64, 0x244)
139146
ELF_RELOC(R_AARCH64_AUTH_RELATIVE, 0x411)
140147

148+
// ELF32
141149
// ELF_RELOC(R_AARCH64_P32_NONE, 0)
142150
ELF_RELOC(R_AARCH64_P32_ABS32, 0x001)
143151
ELF_RELOC(R_AARCH64_P32_ABS16, 0x002)
@@ -216,7 +224,7 @@ ELF_RELOC(R_AARCH64_P32_TLSDESC_ADR_PAGE21, 0x07c)
216224
ELF_RELOC(R_AARCH64_P32_TLSDESC_LD32_LO12, 0x07d)
217225
ELF_RELOC(R_AARCH64_P32_TLSDESC_ADD_LO12, 0x07e)
218226
ELF_RELOC(R_AARCH64_P32_TLSDESC_CALL, 0x07f)
219-
// Dynamic relocations start
227+
// Dynamic relocations
220228
ELF_RELOC(R_AARCH64_P32_COPY, 0x0b4)
221229
ELF_RELOC(R_AARCH64_P32_GLOB_DAT, 0x0b5)
222230
ELF_RELOC(R_AARCH64_P32_JUMP_SLOT, 0x0b6)

0 commit comments

Comments
 (0)