Skip to content

Commit a5fc4ea

Browse files
committed
sync elf mach-o
1 parent 0325b2c commit a5fc4ea

File tree

12 files changed

+652
-110
lines changed

12 files changed

+652
-110
lines changed

vendor/bela.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/fcharlie/bela/tree/2f4ee32be087c8e56d41121b71f35916edf55d21
1+
https://github.com/fcharlie/bela/tree/000e92b75bf42fe19831fe0322b9410a506883e3

vendor/bela/include/hazel/details/ELFRelocs/AArch64.def

Lines changed: 39 additions & 6 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)
@@ -59,11 +60,16 @@ ELF_RELOC(R_AARCH64_ADR_GOT_PAGE, 0x137)
5960
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)
63+
ELF_RELOC(R_AARCH64_GOTPCREL32, 0x13b)
64+
ELF_RELOC(R_AARCH64_PATCHINST, 0x13c)
65+
ELF_RELOC(R_AARCH64_FUNCINIT64, 0x13d)
66+
// General dynamic TLS relocations
6267
ELF_RELOC(R_AARCH64_TLSGD_ADR_PREL21, 0x200)
6368
ELF_RELOC(R_AARCH64_TLSGD_ADR_PAGE21, 0x201)
6469
ELF_RELOC(R_AARCH64_TLSGD_ADD_LO12_NC, 0x202)
6570
ELF_RELOC(R_AARCH64_TLSGD_MOVW_G1, 0x203)
6671
ELF_RELOC(R_AARCH64_TLSGD_MOVW_G0_NC, 0x204)
72+
// Local dynamic TLS relocations
6773
ELF_RELOC(R_AARCH64_TLSLD_ADR_PREL21, 0x205)
6874
ELF_RELOC(R_AARCH64_TLSLD_ADR_PAGE21, 0x206)
6975
ELF_RELOC(R_AARCH64_TLSLD_ADD_LO12_NC, 0x207)
@@ -91,6 +97,7 @@ ELF_RELOC(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 0x21c)
9197
ELF_RELOC(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 0x21d)
9298
ELF_RELOC(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 0x21e)
9399
ELF_RELOC(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 0x21f)
100+
// Local exec TLS relocations
94101
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G2, 0x220)
95102
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1, 0x221)
96103
ELF_RELOC(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 0x222)
@@ -107,6 +114,7 @@ ELF_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12, 0x22c)
107114
ELF_RELOC(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 0x22d)
108115
ELF_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12, 0x22e)
109116
ELF_RELOC(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 0x22f)
117+
// TLS descriptor relocations
110118
ELF_RELOC(R_AARCH64_TLSDESC_LD_PREL19, 0x230)
111119
ELF_RELOC(R_AARCH64_TLSDESC_ADR_PREL21, 0x231)
112120
ELF_RELOC(R_AARCH64_TLSDESC_ADR_PAGE21, 0x232)
@@ -121,7 +129,7 @@ ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12, 0x23a)
121129
ELF_RELOC(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 0x23b)
122130
ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 0x23c)
123131
ELF_RELOC(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 0x23d)
124-
// Dynamic relocations start
132+
// Dynamic relocations
125133
ELF_RELOC(R_AARCH64_COPY, 0x400)
126134
ELF_RELOC(R_AARCH64_GLOB_DAT, 0x401)
127135
ELF_RELOC(R_AARCH64_JUMP_SLOT, 0x402)
@@ -134,7 +142,32 @@ ELF_RELOC(R_AARCH64_TLS_DTPREL64, 0x405)
134142
ELF_RELOC(R_AARCH64_TLS_TPREL64, 0x406)
135143
ELF_RELOC(R_AARCH64_TLSDESC, 0x407)
136144
ELF_RELOC(R_AARCH64_IRELATIVE, 0x408)
145+
// PAuthABI static and dynamic relocations: defined in pauthabielf64,
146+
// https://github.com/ARM-software/abi-aa
147+
ELF_RELOC(R_AARCH64_AUTH_ABS64, 0x244)
148+
ELF_RELOC(R_AARCH64_AUTH_MOVW_GOTOFF_G0, 0x245)
149+
ELF_RELOC(R_AARCH64_AUTH_MOVW_GOTOFF_G0_NC, 0x246)
150+
ELF_RELOC(R_AARCH64_AUTH_MOVW_GOTOFF_G1, 0x247)
151+
ELF_RELOC(R_AARCH64_AUTH_MOVW_GOTOFF_G1_NC, 0x248)
152+
ELF_RELOC(R_AARCH64_AUTH_MOVW_GOTOFF_G2, 0x249)
153+
ELF_RELOC(R_AARCH64_AUTH_MOVW_GOTOFF_G2_NC, 0x24a)
154+
ELF_RELOC(R_AARCH64_AUTH_MOVW_GOTOFF_G3, 0x24b)
155+
ELF_RELOC(R_AARCH64_AUTH_GOT_LD_PREL19, 0x24c)
156+
ELF_RELOC(R_AARCH64_AUTH_LD64_GOTOFF_LO15, 0x24d)
157+
ELF_RELOC(R_AARCH64_AUTH_ADR_GOT_PAGE, 0x24e)
158+
ELF_RELOC(R_AARCH64_AUTH_LD64_GOT_LO12_NC, 0x24f)
159+
ELF_RELOC(R_AARCH64_AUTH_LD64_GOTPAGE_LO15, 0x250)
160+
ELF_RELOC(R_AARCH64_AUTH_GOT_ADD_LO12_NC, 0x251)
161+
ELF_RELOC(R_AARCH64_AUTH_GOT_ADR_PREL_LO21, 0x252)
162+
ELF_RELOC(R_AARCH64_AUTH_TLSDESC_ADR_PAGE21, 0x253)
163+
ELF_RELOC(R_AARCH64_AUTH_TLSDESC_LD64_LO12, 0x254)
164+
ELF_RELOC(R_AARCH64_AUTH_TLSDESC_ADD_LO12, 0x255)
165+
ELF_RELOC(R_AARCH64_AUTH_RELATIVE, 0x411)
166+
ELF_RELOC(R_AARCH64_AUTH_GLOB_DAT, 0x412)
167+
ELF_RELOC(R_AARCH64_AUTH_TLSDESC, 0x413)
168+
ELF_RELOC(R_AARCH64_AUTH_IRELATIVE, 0x414)
137169

170+
// ELF32
138171
// ELF_RELOC(R_AARCH64_P32_NONE, 0)
139172
ELF_RELOC(R_AARCH64_P32_ABS32, 0x001)
140173
ELF_RELOC(R_AARCH64_P32_ABS16, 0x002)
@@ -213,7 +246,7 @@ ELF_RELOC(R_AARCH64_P32_TLSDESC_ADR_PAGE21, 0x07c)
213246
ELF_RELOC(R_AARCH64_P32_TLSDESC_LD32_LO12, 0x07d)
214247
ELF_RELOC(R_AARCH64_P32_TLSDESC_ADD_LO12, 0x07e)
215248
ELF_RELOC(R_AARCH64_P32_TLSDESC_CALL, 0x07f)
216-
// Dynamic relocations start
249+
// Dynamic relocations
217250
ELF_RELOC(R_AARCH64_P32_COPY, 0x0b4)
218251
ELF_RELOC(R_AARCH64_P32_GLOB_DAT, 0x0b5)
219252
ELF_RELOC(R_AARCH64_P32_JUMP_SLOT, 0x0b6)

vendor/bela/include/hazel/details/ELFRelocs/ARM.def

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,18 @@ ELF_RELOC(R_ARM_PRIVATE_15, 0x7f)
135135
ELF_RELOC(R_ARM_ME_TOO, 0x80)
136136
ELF_RELOC(R_ARM_THM_TLS_DESCSEQ16, 0x81)
137137
ELF_RELOC(R_ARM_THM_TLS_DESCSEQ32, 0x82)
138+
ELF_RELOC(R_ARM_THM_ALU_ABS_G0_NC, 0x84)
139+
ELF_RELOC(R_ARM_THM_ALU_ABS_G1_NC, 0x85)
140+
ELF_RELOC(R_ARM_THM_ALU_ABS_G2_NC, 0x86)
141+
ELF_RELOC(R_ARM_THM_ALU_ABS_G3, 0x87)
138142
ELF_RELOC(R_ARM_THM_BF16, 0x88)
139143
ELF_RELOC(R_ARM_THM_BF12, 0x89)
140144
ELF_RELOC(R_ARM_THM_BF18, 0x8a)
141145
ELF_RELOC(R_ARM_IRELATIVE, 0xa0)
146+
ELF_RELOC(R_ARM_GOTFUNCDESC, 0xa1)
147+
ELF_RELOC(R_ARM_GOTOFFFUNCDESC, 0xa2)
148+
ELF_RELOC(R_ARM_FUNCDESC, 0xa3)
149+
ELF_RELOC(R_ARM_FUNCDESC_VALUE, 0xa4)
150+
ELF_RELOC(R_ARM_TLS_GD32_FDPIC, 0xa5)
151+
ELF_RELOC(R_ARM_TLS_LDM32_FDPIC, 0xa6)
152+
ELF_RELOC(R_ARM_TLS_IE32_FDPIC, 0xa7)

vendor/bela/include/hazel/details/ELFRelocs/LoongArch.def

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,50 @@ ELF_RELOC(R_LARCH_TLS_LD_HI20, 96)
102102
ELF_RELOC(R_LARCH_TLS_GD_PC_HI20, 97)
103103
ELF_RELOC(R_LARCH_TLS_GD_HI20, 98)
104104
ELF_RELOC(R_LARCH_32_PCREL, 99)
105-
ELF_RELOC(R_LARCH_RELAX, 100)
105+
ELF_RELOC(R_LARCH_RELAX, 100)
106+
107+
// Relocs added in ELF for the LoongArch™ Architecture v20230519, part of the
108+
// v2.10 LoongArch ABI specs.
109+
//
110+
// Spec addition: https://github.com/loongson/la-abi-specs/pull/1
111+
// Binutils commit 57a930e3bfe4b2c7fd6463ed39311e1938513138
112+
// Note that the 101 and 104 relocation numbers are defined as R_LARCH_DELETE
113+
// and R_LARCH_CFA respectively in psABI 2.10. But they are marked as reserved
114+
// in psABI v2.20 because they were proved not necessary to be exposed outside
115+
// of the linker.
116+
ELF_RELOC(R_LARCH_ALIGN, 102)
117+
ELF_RELOC(R_LARCH_PCREL20_S2, 103)
118+
ELF_RELOC(R_LARCH_ADD6, 105)
119+
ELF_RELOC(R_LARCH_SUB6, 106)
120+
ELF_RELOC(R_LARCH_ADD_ULEB128, 107)
121+
ELF_RELOC(R_LARCH_SUB_ULEB128, 108)
122+
ELF_RELOC(R_LARCH_64_PCREL, 109)
123+
124+
// Relocs added in ELF for the LoongArch™ Architecture v20231102, part of the
125+
// v2.20 LoongArch ABI specs.
126+
//
127+
// Spec addition: https://github.com/loongson/la-abi-specs/pull/4
128+
ELF_RELOC(R_LARCH_CALL36, 110)
129+
130+
// Relocs added in ELF for the LoongArch™ Architecture v20231219, part of the
131+
// v2.30 LoongArch ABI specs.
132+
//
133+
// Spec addition: https://github.com/loongson/la-abi-specs/pull/5
134+
ELF_RELOC(R_LARCH_TLS_DESC32, 13)
135+
ELF_RELOC(R_LARCH_TLS_DESC64, 14)
136+
ELF_RELOC(R_LARCH_TLS_DESC_PC_HI20, 111)
137+
ELF_RELOC(R_LARCH_TLS_DESC_PC_LO12, 112)
138+
ELF_RELOC(R_LARCH_TLS_DESC64_PC_LO20, 113)
139+
ELF_RELOC(R_LARCH_TLS_DESC64_PC_HI12, 114)
140+
ELF_RELOC(R_LARCH_TLS_DESC_HI20, 115)
141+
ELF_RELOC(R_LARCH_TLS_DESC_LO12, 116)
142+
ELF_RELOC(R_LARCH_TLS_DESC64_LO20, 117)
143+
ELF_RELOC(R_LARCH_TLS_DESC64_HI12, 118)
144+
ELF_RELOC(R_LARCH_TLS_DESC_LD, 119)
145+
ELF_RELOC(R_LARCH_TLS_DESC_CALL, 120)
146+
ELF_RELOC(R_LARCH_TLS_LE_HI20_R, 121)
147+
ELF_RELOC(R_LARCH_TLS_LE_ADD_R, 122)
148+
ELF_RELOC(R_LARCH_TLS_LE_LO12_R, 123)
149+
ELF_RELOC(R_LARCH_TLS_LD_PCREL20_S2, 124)
150+
ELF_RELOC(R_LARCH_TLS_GD_PCREL20_S2, 125)
151+
ELF_RELOC(R_LARCH_TLS_DESC_PCREL20_S2, 126)

vendor/bela/include/hazel/details/ELFRelocs/RISCV.def

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ELF_RELOC(R_RISCV_TLS_DTPREL32, 8)
1515
ELF_RELOC(R_RISCV_TLS_DTPREL64, 9)
1616
ELF_RELOC(R_RISCV_TLS_TPREL32, 10)
1717
ELF_RELOC(R_RISCV_TLS_TPREL64, 11)
18+
ELF_RELOC(R_RISCV_TLSDESC, 12)
1819
ELF_RELOC(R_RISCV_BRANCH, 16)
1920
ELF_RELOC(R_RISCV_JAL, 17)
2021
ELF_RELOC(R_RISCV_CALL, 18)
@@ -40,12 +41,10 @@ ELF_RELOC(R_RISCV_SUB8, 37)
4041
ELF_RELOC(R_RISCV_SUB16, 38)
4142
ELF_RELOC(R_RISCV_SUB32, 39)
4243
ELF_RELOC(R_RISCV_SUB64, 40)
43-
ELF_RELOC(R_RISCV_GNU_VTINHERIT, 41)
44-
ELF_RELOC(R_RISCV_GNU_VTENTRY, 42)
44+
ELF_RELOC(R_RISCV_GOT32_PCREL, 41)
4545
ELF_RELOC(R_RISCV_ALIGN, 43)
4646
ELF_RELOC(R_RISCV_RVC_BRANCH, 44)
4747
ELF_RELOC(R_RISCV_RVC_JUMP, 45)
48-
ELF_RELOC(R_RISCV_RVC_LUI, 46)
4948
ELF_RELOC(R_RISCV_RELAX, 51)
5049
ELF_RELOC(R_RISCV_SUB6, 52)
5150
ELF_RELOC(R_RISCV_SET6, 53)
@@ -54,3 +53,75 @@ ELF_RELOC(R_RISCV_SET16, 55)
5453
ELF_RELOC(R_RISCV_SET32, 56)
5554
ELF_RELOC(R_RISCV_32_PCREL, 57)
5655
ELF_RELOC(R_RISCV_IRELATIVE, 58)
56+
ELF_RELOC(R_RISCV_PLT32, 59)
57+
ELF_RELOC(R_RISCV_SET_ULEB128, 60)
58+
ELF_RELOC(R_RISCV_SUB_ULEB128, 61)
59+
ELF_RELOC(R_RISCV_TLSDESC_HI20, 62)
60+
ELF_RELOC(R_RISCV_TLSDESC_LOAD_LO12, 63)
61+
ELF_RELOC(R_RISCV_TLSDESC_ADD_LO12, 64)
62+
ELF_RELOC(R_RISCV_TLSDESC_CALL, 65)
63+
ELF_RELOC(R_RISCV_VENDOR, 191)
64+
ELF_RELOC(R_RISCV_CUSTOM192, 192)
65+
ELF_RELOC(R_RISCV_CUSTOM193, 193)
66+
ELF_RELOC(R_RISCV_CUSTOM194, 194)
67+
ELF_RELOC(R_RISCV_CUSTOM195, 195)
68+
ELF_RELOC(R_RISCV_CUSTOM196, 196)
69+
ELF_RELOC(R_RISCV_CUSTOM197, 197)
70+
ELF_RELOC(R_RISCV_CUSTOM198, 198)
71+
ELF_RELOC(R_RISCV_CUSTOM199, 199)
72+
ELF_RELOC(R_RISCV_CUSTOM200, 200)
73+
ELF_RELOC(R_RISCV_CUSTOM201, 201)
74+
ELF_RELOC(R_RISCV_CUSTOM202, 202)
75+
ELF_RELOC(R_RISCV_CUSTOM203, 203)
76+
ELF_RELOC(R_RISCV_CUSTOM204, 204)
77+
ELF_RELOC(R_RISCV_CUSTOM205, 205)
78+
ELF_RELOC(R_RISCV_CUSTOM206, 206)
79+
ELF_RELOC(R_RISCV_CUSTOM207, 207)
80+
ELF_RELOC(R_RISCV_CUSTOM208, 208)
81+
ELF_RELOC(R_RISCV_CUSTOM209, 209)
82+
ELF_RELOC(R_RISCV_CUSTOM210, 210)
83+
ELF_RELOC(R_RISCV_CUSTOM211, 211)
84+
ELF_RELOC(R_RISCV_CUSTOM212, 212)
85+
ELF_RELOC(R_RISCV_CUSTOM213, 213)
86+
ELF_RELOC(R_RISCV_CUSTOM214, 214)
87+
ELF_RELOC(R_RISCV_CUSTOM215, 215)
88+
ELF_RELOC(R_RISCV_CUSTOM216, 216)
89+
ELF_RELOC(R_RISCV_CUSTOM217, 217)
90+
ELF_RELOC(R_RISCV_CUSTOM218, 218)
91+
ELF_RELOC(R_RISCV_CUSTOM219, 219)
92+
ELF_RELOC(R_RISCV_CUSTOM220, 220)
93+
ELF_RELOC(R_RISCV_CUSTOM221, 221)
94+
ELF_RELOC(R_RISCV_CUSTOM222, 222)
95+
ELF_RELOC(R_RISCV_CUSTOM223, 223)
96+
ELF_RELOC(R_RISCV_CUSTOM224, 224)
97+
ELF_RELOC(R_RISCV_CUSTOM225, 225)
98+
ELF_RELOC(R_RISCV_CUSTOM226, 226)
99+
ELF_RELOC(R_RISCV_CUSTOM227, 227)
100+
ELF_RELOC(R_RISCV_CUSTOM228, 228)
101+
ELF_RELOC(R_RISCV_CUSTOM229, 229)
102+
ELF_RELOC(R_RISCV_CUSTOM230, 230)
103+
ELF_RELOC(R_RISCV_CUSTOM231, 231)
104+
ELF_RELOC(R_RISCV_CUSTOM232, 232)
105+
ELF_RELOC(R_RISCV_CUSTOM233, 233)
106+
ELF_RELOC(R_RISCV_CUSTOM234, 234)
107+
ELF_RELOC(R_RISCV_CUSTOM235, 235)
108+
ELF_RELOC(R_RISCV_CUSTOM236, 236)
109+
ELF_RELOC(R_RISCV_CUSTOM237, 237)
110+
ELF_RELOC(R_RISCV_CUSTOM238, 238)
111+
ELF_RELOC(R_RISCV_CUSTOM239, 239)
112+
ELF_RELOC(R_RISCV_CUSTOM240, 240)
113+
ELF_RELOC(R_RISCV_CUSTOM241, 241)
114+
ELF_RELOC(R_RISCV_CUSTOM242, 242)
115+
ELF_RELOC(R_RISCV_CUSTOM243, 243)
116+
ELF_RELOC(R_RISCV_CUSTOM244, 244)
117+
ELF_RELOC(R_RISCV_CUSTOM245, 245)
118+
ELF_RELOC(R_RISCV_CUSTOM246, 246)
119+
ELF_RELOC(R_RISCV_CUSTOM247, 247)
120+
ELF_RELOC(R_RISCV_CUSTOM248, 248)
121+
ELF_RELOC(R_RISCV_CUSTOM249, 249)
122+
ELF_RELOC(R_RISCV_CUSTOM250, 250)
123+
ELF_RELOC(R_RISCV_CUSTOM251, 251)
124+
ELF_RELOC(R_RISCV_CUSTOM252, 252)
125+
ELF_RELOC(R_RISCV_CUSTOM253, 253)
126+
ELF_RELOC(R_RISCV_CUSTOM254, 254)
127+
ELF_RELOC(R_RISCV_CUSTOM255, 255)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//===--- RISC-V Nonstandard Relocation List ---------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef ELF_RISCV_NONSTANDARD_RELOC
10+
#error "ELF_RISCV_NONSTANDARD_RELOC must be defined"
11+
#endif
12+
13+
// ELF_RISCV_NONSTANDARD_RELOC(VENDOR, NAME, ID) defines information about
14+
// nonstandard relocation codes. This can be used when parsing relocations, or
15+
// when printing them, to provide better information.
16+
//
17+
// VENDOR should be the symbol name expected in the associated `R_RISCV_VENDOR`
18+
// relocation. NAME and ID work like `ELF_RELOC` but the mapping is not expected
19+
// to be 1:1.
20+
//
21+
// The mapping in RISCV.def is 1:1, and should be used when the only information
22+
// available is the relocation enum value.
23+
24+
// Qualcomm Nonstandard Relocations
25+
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_ABS20_U, 192)
26+
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_BRANCH, 193)
27+
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_32, 194)
28+
ELF_RISCV_NONSTANDARD_RELOC(QUALCOMM, R_RISCV_QC_E_CALL_PLT, 195)
29+
30+
// Andes Nonstandard Relocations
31+
// Calculation: S + A - P (10-bit PC-relative branch offset)
32+
ELF_RISCV_NONSTANDARD_RELOC(ANDES, R_RISCV_NDS_BRANCH_10, 241)

vendor/bela/include/hazel/details/ELFRelocs/Sparc.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,8 @@ ELF_RELOC(R_SPARC_GOTDATA_LOX10, 81)
8787
ELF_RELOC(R_SPARC_GOTDATA_OP_HIX22, 82)
8888
ELF_RELOC(R_SPARC_GOTDATA_OP_LOX10, 83)
8989
ELF_RELOC(R_SPARC_GOTDATA_OP, 84)
90+
ELF_RELOC(R_SPARC_H34, 85)
91+
ELF_RELOC(R_SPARC_SIZE32, 86)
92+
ELF_RELOC(R_SPARC_SIZE64, 87)
93+
ELF_RELOC(R_SPARC_WDISP10, 88)
94+
ELF_RELOC(R_SPARC_IRELATIVE, 249)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#ifndef ELF_RELOC
2+
#error "ELF_RELOC must be defined"
3+
#endif
4+
5+
ELF_RELOC(R_XTENSA_NONE, 0)
6+
ELF_RELOC(R_XTENSA_32, 1)
7+
ELF_RELOC(R_XTENSA_RTLD, 2)
8+
ELF_RELOC(R_XTENSA_GLOB_DAT, 3)
9+
ELF_RELOC(R_XTENSA_JMP_SLOT, 4)
10+
ELF_RELOC(R_XTENSA_RELATIVE, 5)
11+
ELF_RELOC(R_XTENSA_PLT, 6)
12+
// RELOC '7' currently is not used.
13+
ELF_RELOC(R_XTENSA_OP0, 8)
14+
ELF_RELOC(R_XTENSA_OP1, 9)
15+
ELF_RELOC(R_XTENSA_OP2, 10)
16+
ELF_RELOC(R_XTENSA_ASM_EXPAND, 11)
17+
ELF_RELOC(R_XTENSA_ASM_SIMPLIFY, 12)
18+
ELF_RELOC(R_XTENSA_32_PCREL, 14)
19+
ELF_RELOC(R_XTENSA_GNU_VTINHERIT, 15)
20+
ELF_RELOC(R_XTENSA_GNU_VTENTRY, 16)
21+
ELF_RELOC(R_XTENSA_DIFF8, 17)
22+
ELF_RELOC(R_XTENSA_DIFF16, 18)
23+
ELF_RELOC(R_XTENSA_DIFF32, 19)
24+
ELF_RELOC(R_XTENSA_SLOT0_OP, 20)
25+
ELF_RELOC(R_XTENSA_SLOT1_OP, 21)
26+
ELF_RELOC(R_XTENSA_SLOT2_OP, 22)
27+
ELF_RELOC(R_XTENSA_SLOT3_OP, 23)
28+
ELF_RELOC(R_XTENSA_SLOT4_OP, 24)
29+
ELF_RELOC(R_XTENSA_SLOT5_OP, 25)
30+
ELF_RELOC(R_XTENSA_SLOT6_OP, 26)
31+
ELF_RELOC(R_XTENSA_SLOT7_OP, 27)
32+
ELF_RELOC(R_XTENSA_SLOT8_OP, 28)
33+
ELF_RELOC(R_XTENSA_SLOT9_OP, 29)
34+
ELF_RELOC(R_XTENSA_SLOT10_OP, 30)
35+
ELF_RELOC(R_XTENSA_SLOT11_OP, 31)
36+
ELF_RELOC(R_XTENSA_SLOT12_OP, 32)
37+
ELF_RELOC(R_XTENSA_SLOT13_OP, 33)
38+
ELF_RELOC(R_XTENSA_SLOT14_OP, 34)
39+
ELF_RELOC(R_XTENSA_SLOT0_ALT, 35)
40+
ELF_RELOC(R_XTENSA_SLOT1_ALT, 36)
41+
ELF_RELOC(R_XTENSA_SLOT2_ALT, 37)
42+
ELF_RELOC(R_XTENSA_SLOT3_ALT, 38)
43+
ELF_RELOC(R_XTENSA_SLOT4_ALT, 39)
44+
ELF_RELOC(R_XTENSA_SLOT5_ALT, 40)
45+
ELF_RELOC(R_XTENSA_SLOT6_ALT, 41)
46+
ELF_RELOC(R_XTENSA_SLOT7_ALT, 42)
47+
ELF_RELOC(R_XTENSA_SLOT8_ALT, 43)
48+
ELF_RELOC(R_XTENSA_SLOT9_ALT, 44)
49+
ELF_RELOC(R_XTENSA_SLOT10_ALT, 45)
50+
ELF_RELOC(R_XTENSA_SLOT11_ALT, 46)
51+
ELF_RELOC(R_XTENSA_SLOT12_ALT, 47)
52+
ELF_RELOC(R_XTENSA_SLOT13_ALT, 48)
53+
ELF_RELOC(R_XTENSA_SLOT14_ALT, 49)
54+
ELF_RELOC(R_XTENSA_TLSDESC_FN, 50)
55+
ELF_RELOC(R_XTENSA_TLSDESC_ARG, 51)
56+
ELF_RELOC(R_XTENSA_TLS_DTPOFF, 52)
57+
ELF_RELOC(R_XTENSA_TLS_TPOFF, 53)
58+
ELF_RELOC(R_XTENSA_TLS_FUNC, 54)
59+
ELF_RELOC(R_XTENSA_TLS_ARG, 55)
60+
ELF_RELOC(R_XTENSA_TLS_CALL, 56)

vendor/bela/include/hazel/details/ELFRelocs/x86_64.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ ELF_RELOC(R_X86_64_TLSDESC, 36)
4343
ELF_RELOC(R_X86_64_IRELATIVE, 37)
4444
ELF_RELOC(R_X86_64_GOTPCRELX, 41)
4545
ELF_RELOC(R_X86_64_REX_GOTPCRELX, 42)
46+
ELF_RELOC(R_X86_64_CODE_4_GOTPCRELX, 43)
47+
ELF_RELOC(R_X86_64_CODE_4_GOTTPOFF, 44)
48+
ELF_RELOC(R_X86_64_CODE_4_GOTPC32_TLSDESC, 45)
49+
ELF_RELOC(R_X86_64_CODE_6_GOTTPOFF, 50)

0 commit comments

Comments
 (0)