xref: /openbsd/sys/arch/arm64/include/reloc.h (revision 6f40fd34)
1 /*	$OpenBSD: reloc.h,v 1.1 2016/12/17 23:38:33 patrick Exp $	*/
2 /*
3  * AArch64 static relocation types.
4  */
5 
6 /* Miscellaneous. */
7 #define R_ARM_NONE			0
8 #define R_AARCH64_TPOFF64	1 /// COMPLETELY WRONG - stub
9 #define R_AARCH64_NONE			256
10 
11 /* Data. */
12 #define R_AARCH64_ABS64			257
13 #define R_AARCH64_ABS32			258
14 #define R_AARCH64_ABS16			259
15 #define R_AARCH64_PREL64		260
16 #define R_AARCH64_PREL32		261
17 #define R_AARCH64_PREL16		262
18 
19 /* Instructions. */
20 #define R_AARCH64_MOVW_UABS_G0		263
21 #define R_AARCH64_MOVW_UABS_G0_NC	264
22 #define R_AARCH64_MOVW_UABS_G1		265
23 #define R_AARCH64_MOVW_UABS_G1_NC	266
24 #define R_AARCH64_MOVW_UABS_G2		267
25 #define R_AARCH64_MOVW_UABS_G2_NC	268
26 #define R_AARCH64_MOVW_UABS_G3		269
27 
28 #define R_AARCH64_MOVW_SABS_G0		270
29 #define R_AARCH64_MOVW_SABS_G1		271
30 #define R_AARCH64_MOVW_SABS_G2		272
31 
32 #define R_AARCH64_LD_PREL_LO19		273
33 #define R_AARCH64_ADR_PREL_LO21		274
34 #define R_AARCH64_ADR_PREL_PG_HI21	275
35 #define R_AARCH64_ADR_PREL_PG_HI21_NC	276
36 #define R_AARCH64_ADD_ABS_LO12_NC	277
37 #define R_AARCH64_LDST8_ABS_LO12_NC	278
38 
39 #define R_AARCH64_TSTBR14		279
40 #define R_AARCH64_CONDBR19		280
41 #define R_AARCH64_JUMP26		282
42 #define R_AARCH64_CALL26		283
43 #define R_AARCH64_LDST16_ABS_LO12_NC	284
44 #define R_AARCH64_LDST32_ABS_LO12_NC	285
45 #define R_AARCH64_LDST64_ABS_LO12_NC	286
46 #define R_AARCH64_LDST128_ABS_LO12_NC	299
47 
48 #define R_AARCH64_MOVW_PREL_G0		287
49 #define R_AARCH64_MOVW_PREL_G0_NC	288
50 #define R_AARCH64_MOVW_PREL_G1		289
51 #define R_AARCH64_MOVW_PREL_G1_NC	290
52 #define R_AARCH64_MOVW_PREL_G2		291
53 #define R_AARCH64_MOVW_PREL_G2_NC	292
54 #define R_AARCH64_MOVW_PREL_G3		293
55 
56 
57 #define R_AARCH64_COPY 1024
58 #define R_AARCH64_GLOB_DAT 1025 // S + A
59 #define R_AARCH64_JUMP_SLOT 1026 // S + A
60 #define R_AARCH64_RELATIVE 1027 // Delta(S) + A
61 #define R_AARCH64_TLS_DTPREL64 1028 // DTPREL(S+A)
62 #define R_AARCH64_TLS_DTPMOD64 1029 // LDM(S)
63 #define R_AARCH64_TLS_TPREL64 1030 // TPREL(S+A)
64 #define R_AARCH64_TLSDESC 1031 // TLSDESC(S+A) TLS descriptor to be filled
65 #define R_AARCH64_IRELATIVE 1032 // Indirect(Delta(S) + A)
66 
67 // old arm32 defines.
68 /* Processor specific relocation types */
69 
70 #define R_ARM_NONE		0
71 #define R_ARM_PC24		1
72 #define R_ARM_ABS32		2
73 #define R_ARM_REL32		3
74 #define R_ARM_PC13		4
75 #define R_ARM_ABS16		5
76 #define R_ARM_ABS12		6
77 #define R_ARM_THM_ABS5		7
78 #define R_ARM_ABS8		8
79 #define R_ARM_SBREL32		9
80 #define R_ARM_THM_PC22		10
81 #define R_ARM_THM_PC8		11
82 #define R_ARM_AMP_VCALL9	12
83 #define R_ARM_SWI24		13
84 #define R_ARM_THM_SWI8		14
85 #define R_ARM_XPC25		15
86 #define R_ARM_THM_XPC22		16
87 
88 /* 17-31 are reserved for ARM Linux. */
89 #define R_ARM_TLS_DTPMOD32	17
90 #define R_ARM_TLS_DTPOFF32	18
91 #define R_ARM_TLS_TPOFF32	19
92 
93 #define R_ARM_COPY		20
94 #define R_ARM_GLOB_DAT		21
95 #define	R_ARM_JUMP_SLOT		22
96 #define R_ARM_RELATIVE		23
97 #define	R_ARM_GOTOFF		24
98 #define R_ARM_GOTPC		25
99 #define R_ARM_GOT32		26
100 #define R_ARM_PLT32		27
101 
102 #define R_ARM_ALU_PCREL_7_0	32
103 #define R_ARM_ALU_PCREL_15_8	33
104 #define R_ARM_ALU_PCREL_23_15	34
105 #define R_ARM_ALU_SBREL_11_0	35
106 #define R_ARM_ALU_SBREL_19_12	36
107 #define R_ARM_ALU_SBREL_27_20	37
108 
109 /* 96-111 are reserved to G++. */
110 #define R_ARM_GNU_VTENTRY	100
111 #define R_ARM_GNU_VTINHERIT	101
112 #define R_ARM_THM_PC11		102
113 #define R_ARM_THM_PC9		103
114 
115 /* 112-127 are reserved for private experiments. */
116 
117 #define R_ARM_RXPC25		249
118 #define R_ARM_RSBREL32		250
119 #define R_ARM_THM_RPC22		251
120 #define R_ARM_RREL32		252
121 #define R_ARM_RABS32		253
122 #define R_ARM_RPC24		254
123 #define R_ARM_RBASE		255
124 
125 
126 
127