1 1.1 christos /* AArch64 ELF support for BFD. 2 1.1 christos 3 1.10 christos Copyright (C) 2009-2025 Free Software Foundation, Inc. 4 1.1 christos Contributed by ARM Ltd. 5 1.1 christos 6 1.1 christos This file is part of GNU Binutils. 7 1.1 christos 8 1.1 christos This program is free software; you can redistribute it and/or modify 9 1.1 christos it under the terms of the GNU General Public License as published by 10 1.1 christos the Free Software Foundation; either version 3 of the license, or 11 1.1 christos (at your option) any later version. 12 1.1 christos 13 1.1 christos This program is distributed in the hope that it will be useful, 14 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of 15 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 1.1 christos GNU General Public License for more details. 17 1.1 christos 18 1.1 christos You should have received a copy of the GNU General Public License 19 1.1 christos along with this program; see the file COPYING3. If not, 20 1.1 christos see <http://www.gnu.org/licenses/>. */ 21 1.1 christos 22 1.1 christos #ifndef _ELF_AARCH64_H 23 1.1 christos #define _ELF_AARCH64_H 24 1.1 christos 25 1.1 christos #include "elf/reloc-macros.h" 26 1.1 christos 27 1.1 christos /* Processor specific program header types. */ 28 1.1 christos #define PT_AARCH64_ARCHEXT (PT_LOPROC + 0) 29 1.1 christos 30 1.9 christos /* MTE memory tag segment type. */ 31 1.9 christos #define PT_AARCH64_MEMTAG_MTE (PT_LOPROC + 0x2) 32 1.9 christos 33 1.10 christos /* Name of the ELF section holding the attributes. */ 34 1.10 christos #define SEC_AARCH64_ATTRIBUTES ".ARM.attributes" 35 1.1 christos /* Additional section types. */ 36 1.10 christos /* Section holds attributes. */ 37 1.10 christos #define SHT_AARCH64_ATTRIBUTES (SHT_LOPROC + 3) 38 1.10 christos /* Special aarch64-specific section for MTE support, as described in: 39 1.10 christos https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#section-types */ 40 1.10 christos #define SHT_AARCH64_AUTH_RELR (SHT_LOPROC + 4) 41 1.10 christos /* Special aarch64-specific sections for MTE support, as described in: 42 1.10 christos https://github.com/ARM-software/abi-aa/blob/main/memtagabielf64/memtagabielf64.rst#7section-types */ 43 1.10 christos #define SHT_AARCH64_MEMTAG_GLOBALS_STATIC (SHT_LOPROC + 7) 44 1.10 christos #define SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC (SHT_LOPROC + 8) 45 1.1 christos 46 1.1 christos /* AArch64-specific values for sh_flags. */ 47 1.1 christos #define SHF_ENTRYSECT 0x10000000 /* Section contains an 48 1.1 christos entry point. */ 49 1.1 christos #define SHF_COMDEF 0x80000000 /* Section may be multiply defined 50 1.1 christos in the input to a link step. */ 51 1.7 christos /* Processor specific dynamic array tags. */ 52 1.7 christos #define DT_AARCH64_BTI_PLT (DT_LOPROC + 1) 53 1.7 christos #define DT_AARCH64_PAC_PLT (DT_LOPROC + 3) 54 1.7 christos #define DT_AARCH64_VARIANT_PCS (DT_LOPROC + 5) 55 1.10 christos #define DT_AARCH64_MEMTAG_MODE (DT_LOPROC + 9) 56 1.10 christos #define DT_AARCH64_MEMTAG_STACK (DT_LOPROC + 12) 57 1.7 christos 58 1.7 christos /* AArch64-specific values for st_other. */ 59 1.7 christos #define STO_AARCH64_VARIANT_PCS 0x80 /* Symbol may follow different call 60 1.7 christos convention from the base PCS. */ 61 1.1 christos 62 1.1 christos /* Relocation types. */ 63 1.1 christos 64 1.1 christos START_RELOC_NUMBERS (elf_aarch64_reloc_type) 65 1.1 christos 66 1.3 christos /* Null relocations. */ 67 1.1 christos RELOC_NUMBER (R_AARCH64_NONE, 0) /* No reloc */ 68 1.1 christos 69 1.3 christos /* Basic data relocations. */ 70 1.3 christos 71 1.3 christos /* .word: (S+A) */ 72 1.3 christos RELOC_NUMBER (R_AARCH64_P32_ABS32, 1) 73 1.3 christos 74 1.3 christos /* .half: (S+A) */ 75 1.3 christos RELOC_NUMBER (R_AARCH64_P32_ABS16, 2) 76 1.3 christos 77 1.3 christos /* .word: (S+A-P) */ 78 1.3 christos RELOC_NUMBER (R_AARCH64_P32_PREL32, 3) 79 1.3 christos 80 1.3 christos /* .half: (S+A-P) */ 81 1.3 christos RELOC_NUMBER (R_AARCH64_P32_PREL16, 4) 82 1.3 christos 83 1.3 christos /* Group relocations to create a 16, 32, 48 or 64 bit 84 1.3 christos unsigned data or abs address inline. */ 85 1.3 christos 86 1.3 christos /* MOV[ZK]: ((S+A) >> 0) & 0xffff */ 87 1.3 christos RELOC_NUMBER (R_AARCH64_P32_MOVW_UABS_G0, 5) 88 1.3 christos 89 1.3 christos /* MOV[ZK]: ((S+A) >> 0) & 0xffff */ 90 1.3 christos RELOC_NUMBER (R_AARCH64_P32_MOVW_UABS_G0_NC, 6) 91 1.3 christos 92 1.3 christos /* MOV[ZK]: ((S+A) >> 16) & 0xffff */ 93 1.3 christos RELOC_NUMBER (R_AARCH64_P32_MOVW_UABS_G1, 7) 94 1.3 christos 95 1.3 christos /* Group relocations to create high part of a 16, 32, 48 or 64 bit 96 1.3 christos signed data or abs address inline. Will change instruction 97 1.3 christos to MOVN or MOVZ depending on sign of calculated value. */ 98 1.3 christos 99 1.3 christos /* MOV[ZN]: ((S+A) >> 0) & 0xffff */ 100 1.3 christos RELOC_NUMBER (R_AARCH64_P32_MOVW_SABS_G0, 8) 101 1.3 christos 102 1.3 christos /* Relocations to generate 19, 21 and 33 bit PC-relative load/store 103 1.3 christos addresses: PG(x) is (x & ~0xfff). */ 104 1.3 christos 105 1.3 christos /* LD-lit: ((S+A-P) >> 2) & 0x7ffff */ 106 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LD_PREL_LO19, 9) 107 1.3 christos 108 1.3 christos /* ADR: (S+A-P) & 0x1fffff */ 109 1.3 christos RELOC_NUMBER (R_AARCH64_P32_ADR_PREL_LO21, 10) 110 1.3 christos 111 1.3 christos /* ADRH: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */ 112 1.3 christos RELOC_NUMBER (R_AARCH64_P32_ADR_PREL_PG_HI21, 11) 113 1.3 christos 114 1.3 christos /* ADD: (S+A) & 0xfff */ 115 1.3 christos RELOC_NUMBER (R_AARCH64_P32_ADD_ABS_LO12_NC, 12) 116 1.3 christos 117 1.3 christos /* LD/ST8: (S+A) & 0xfff */ 118 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LDST8_ABS_LO12_NC, 13) 119 1.3 christos 120 1.3 christos /* LD/ST16: (S+A) & 0xffe */ 121 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LDST16_ABS_LO12_NC, 14) 122 1.3 christos 123 1.3 christos /* LD/ST32: (S+A) & 0xffc */ 124 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LDST32_ABS_LO12_NC, 15) 125 1.3 christos 126 1.3 christos /* LD/ST64: (S+A) & 0xff8 */ 127 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LDST64_ABS_LO12_NC, 16) 128 1.3 christos 129 1.3 christos /* LD/ST128: (S+A) & 0xff0 */ 130 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LDST128_ABS_LO12_NC, 17) 131 1.3 christos 132 1.3 christos /* Relocations for control-flow instructions. */ 133 1.3 christos 134 1.3 christos /* TBZ/NZ: ((S+A-P) >> 2) & 0x3fff. */ 135 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TSTBR14, 18) 136 1.3 christos 137 1.3 christos /* B.cond: ((S+A-P) >> 2) & 0x7ffff. */ 138 1.3 christos RELOC_NUMBER (R_AARCH64_P32_CONDBR19, 19) 139 1.3 christos 140 1.3 christos /* B: ((S+A-P) >> 2) & 0x3ffffff. */ 141 1.3 christos RELOC_NUMBER (R_AARCH64_P32_JUMP26, 20) 142 1.3 christos 143 1.3 christos /* BL: ((S+A-P) >> 2) & 0x3ffffff. */ 144 1.3 christos RELOC_NUMBER (R_AARCH64_P32_CALL26, 21) 145 1.3 christos 146 1.7 christos /* Group relocations to create a 16 or 32 bit PC-relative offset inline. */ 147 1.7 christos RELOC_NUMBER (R_AARCH64_P32_MOVW_PREL_G0, 22) 148 1.7 christos RELOC_NUMBER (R_AARCH64_P32_MOVW_PREL_G0_NC, 23) 149 1.7 christos RELOC_NUMBER (R_AARCH64_P32_MOVW_PREL_G1, 24) 150 1.3 christos 151 1.3 christos RELOC_NUMBER (R_AARCH64_P32_GOT_LD_PREL19, 25) 152 1.3 christos RELOC_NUMBER (R_AARCH64_P32_ADR_GOT_PAGE, 26) 153 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LD32_GOT_LO12_NC, 27) 154 1.3 christos RELOC_NUMBER (R_AARCH64_P32_LD32_GOTPAGE_LO14, 28) 155 1.3 christos 156 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSGD_ADR_PREL21, 80) 157 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSGD_ADR_PAGE21, 81) 158 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSGD_ADD_LO12_NC, 82) 159 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_ADR_PREL21, 83) 160 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_ADR_PAGE21, 84) 161 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_ADD_LO12_NC, 85) 162 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_MOVW_DTPREL_G1, 87) 163 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_MOVW_DTPREL_G0, 88) 164 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_MOVW_DTPREL_G0_NC, 89) 165 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_ADD_DTPREL_HI12, 90) 166 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12, 91) 167 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12_NC, 92) 168 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21, 103) 169 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC, 104) 170 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19, 105) 171 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_MOVW_TPREL_G1, 106) 172 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_MOVW_TPREL_G0, 107) 173 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC, 108) 174 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_ADD_TPREL_HI12, 109) 175 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_ADD_TPREL_LO12, 110) 176 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC, 111) 177 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST8_TPREL_LO12, 112) 178 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST8_TPREL_LO12_NC, 113) 179 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST16_TPREL_LO12, 114) 180 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST16_TPREL_LO12_NC, 115) 181 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST32_TPREL_LO12, 116) 182 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST32_TPREL_LO12_NC, 117) 183 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST64_TPREL_LO12, 118) 184 1.6 christos RELOC_NUMBER (R_AARCH64_P32_TLSLE_LDST64_TPREL_LO12_NC, 119) 185 1.3 christos 186 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSDESC_LD_PREL19, 122) 187 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSDESC_ADR_PREL21, 123) 188 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSDESC_ADR_PAGE21, 124) 189 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSDESC_LD32_LO12_NC, 125) 190 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSDESC_ADD_LO12_NC, 126) 191 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSDESC_CALL, 127) 192 1.3 christos 193 1.3 christos /* Dynamic relocations */ 194 1.3 christos 195 1.3 christos /* Copy symbol at runtime. */ 196 1.3 christos RELOC_NUMBER (R_AARCH64_P32_COPY, 180) 197 1.3 christos 198 1.3 christos /* Create GOT entry. */ 199 1.3 christos RELOC_NUMBER (R_AARCH64_P32_GLOB_DAT, 181) 200 1.3 christos 201 1.3 christos /* Create PLT entry. */ 202 1.3 christos RELOC_NUMBER (R_AARCH64_P32_JUMP_SLOT, 182) 203 1.3 christos 204 1.3 christos /* Adjust by program base. */ 205 1.3 christos RELOC_NUMBER (R_AARCH64_P32_RELATIVE, 183) 206 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLS_DTPMOD, 184) 207 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLS_DTPREL, 185) 208 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLS_TPREL, 186) 209 1.3 christos RELOC_NUMBER (R_AARCH64_P32_TLSDESC, 187) 210 1.3 christos RELOC_NUMBER (R_AARCH64_P32_IRELATIVE, 188) 211 1.1 christos 212 1.1 christos RELOC_NUMBER (R_AARCH64_NULL, 256) /* No reloc */ 213 1.1 christos 214 1.3 christos /* Basic data relocations. */ 215 1.1 christos 216 1.1 christos /* .xword: (S+A) */ 217 1.1 christos RELOC_NUMBER (R_AARCH64_ABS64, 257) 218 1.1 christos 219 1.1 christos /* .word: (S+A) */ 220 1.1 christos RELOC_NUMBER (R_AARCH64_ABS32, 258) 221 1.1 christos 222 1.1 christos /* .half: (S+A) */ 223 1.1 christos RELOC_NUMBER (R_AARCH64_ABS16, 259) 224 1.1 christos 225 1.1 christos /* .xword: (S+A-P) */ 226 1.1 christos RELOC_NUMBER (R_AARCH64_PREL64, 260) 227 1.1 christos 228 1.1 christos /* .word: (S+A-P) */ 229 1.1 christos RELOC_NUMBER (R_AARCH64_PREL32, 261) 230 1.1 christos 231 1.1 christos /* .half: (S+A-P) */ 232 1.1 christos RELOC_NUMBER (R_AARCH64_PREL16, 262) 233 1.1 christos 234 1.1 christos /* Group relocations to create a 16, 32, 48 or 64 bit 235 1.3 christos unsigned data or abs address inline. */ 236 1.1 christos 237 1.1 christos /* MOV[ZK]: ((S+A) >> 0) & 0xffff */ 238 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_UABS_G0, 263) 239 1.1 christos 240 1.1 christos /* MOV[ZK]: ((S+A) >> 0) & 0xffff */ 241 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_UABS_G0_NC, 264) 242 1.1 christos 243 1.1 christos /* MOV[ZK]: ((S+A) >> 16) & 0xffff */ 244 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_UABS_G1, 265) 245 1.1 christos 246 1.1 christos /* MOV[ZK]: ((S+A) >> 16) & 0xffff */ 247 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_UABS_G1_NC, 266) 248 1.1 christos 249 1.1 christos /* MOV[ZK]: ((S+A) >> 32) & 0xffff */ 250 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_UABS_G2, 267) 251 1.1 christos 252 1.1 christos /* MOV[ZK]: ((S+A) >> 32) & 0xffff */ 253 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_UABS_G2_NC, 268) 254 1.1 christos 255 1.1 christos /* MOV[ZK]: ((S+A) >> 48) & 0xffff */ 256 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_UABS_G3, 269) 257 1.1 christos 258 1.1 christos /* Group relocations to create high part of a 16, 32, 48 or 64 bit 259 1.1 christos signed data or abs address inline. Will change instruction 260 1.3 christos to MOVN or MOVZ depending on sign of calculated value. */ 261 1.1 christos 262 1.1 christos /* MOV[ZN]: ((S+A) >> 0) & 0xffff */ 263 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_SABS_G0, 270) 264 1.1 christos 265 1.1 christos /* MOV[ZN]: ((S+A) >> 16) & 0xffff */ 266 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_SABS_G1, 271) 267 1.1 christos 268 1.1 christos /* MOV[ZN]: ((S+A) >> 32) & 0xffff */ 269 1.1 christos RELOC_NUMBER (R_AARCH64_MOVW_SABS_G2, 272) 270 1.1 christos 271 1.1 christos /* Relocations to generate 19, 21 and 33 bit PC-relative load/store 272 1.3 christos addresses: PG(x) is (x & ~0xfff). */ 273 1.1 christos 274 1.1 christos /* LD-lit: ((S+A-P) >> 2) & 0x7ffff */ 275 1.1 christos RELOC_NUMBER (R_AARCH64_LD_PREL_LO19, 273) 276 1.1 christos 277 1.1 christos /* ADR: (S+A-P) & 0x1fffff */ 278 1.1 christos RELOC_NUMBER (R_AARCH64_ADR_PREL_LO21, 274) 279 1.1 christos 280 1.1 christos /* ADRH: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */ 281 1.1 christos RELOC_NUMBER (R_AARCH64_ADR_PREL_PG_HI21, 275) 282 1.1 christos 283 1.1 christos /* ADRH: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */ 284 1.1 christos RELOC_NUMBER (R_AARCH64_ADR_PREL_PG_HI21_NC, 276) 285 1.1 christos 286 1.1 christos /* ADD: (S+A) & 0xfff */ 287 1.1 christos RELOC_NUMBER (R_AARCH64_ADD_ABS_LO12_NC, 277) 288 1.1 christos 289 1.1 christos /* LD/ST8: (S+A) & 0xfff */ 290 1.1 christos RELOC_NUMBER (R_AARCH64_LDST8_ABS_LO12_NC, 278) 291 1.1 christos 292 1.3 christos /* Relocations for control-flow instructions. */ 293 1.1 christos 294 1.3 christos /* TBZ/NZ: ((S+A-P) >> 2) & 0x3fff. */ 295 1.1 christos RELOC_NUMBER (R_AARCH64_TSTBR14, 279) 296 1.1 christos 297 1.3 christos /* B.cond: ((S+A-P) >> 2) & 0x7ffff. */ 298 1.1 christos RELOC_NUMBER (R_AARCH64_CONDBR19, 280) 299 1.1 christos 300 1.1 christos /* 281 unused */ 301 1.1 christos 302 1.3 christos /* B: ((S+A-P) >> 2) & 0x3ffffff. */ 303 1.1 christos RELOC_NUMBER (R_AARCH64_JUMP26, 282) 304 1.1 christos 305 1.3 christos /* BL: ((S+A-P) >> 2) & 0x3ffffff. */ 306 1.1 christos RELOC_NUMBER (R_AARCH64_CALL26, 283) 307 1.1 christos 308 1.1 christos /* LD/ST16: (S+A) & 0xffe */ 309 1.1 christos RELOC_NUMBER (R_AARCH64_LDST16_ABS_LO12_NC, 284) 310 1.1 christos 311 1.1 christos /* LD/ST32: (S+A) & 0xffc */ 312 1.1 christos RELOC_NUMBER (R_AARCH64_LDST32_ABS_LO12_NC, 285) 313 1.1 christos 314 1.1 christos /* LD/ST64: (S+A) & 0xff8 */ 315 1.1 christos RELOC_NUMBER (R_AARCH64_LDST64_ABS_LO12_NC, 286) 316 1.1 christos 317 1.3 christos /* Group relocations to create a 16, 32, 48, or 64 bit PC-relative 318 1.3 christos offset inline. */ 319 1.3 christos 320 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_PREL_G0, 287) 321 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_PREL_G0_NC, 288) 322 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_PREL_G1, 289) 323 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_PREL_G1_NC, 290) 324 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_PREL_G2, 291) 325 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_PREL_G2_NC, 292) 326 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_PREL_G3, 293) 327 1.3 christos 328 1.1 christos /* LD/ST128: (S+A) & 0xff0 */ 329 1.1 christos RELOC_NUMBER (R_AARCH64_LDST128_ABS_LO12_NC, 299) 330 1.1 christos 331 1.3 christos /* Group relocations to create a 16, 32, 48, or 64 bit GOT-relative 332 1.3 christos offset inline. */ 333 1.3 christos 334 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_GOTOFF_G0, 300) 335 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_GOTOFF_G0_NC, 301) 336 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_GOTOFF_G1, 302) 337 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_GOTOFF_G1_NC, 303) 338 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_GOTOFF_G2, 304) 339 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_GOTOFF_G2_NC, 305) 340 1.3 christos RELOC_NUMBER (R_AARCH64_MOVW_GOTOFF_G3, 306) 341 1.3 christos 342 1.3 christos /* GOT-relative data relocations. */ 343 1.3 christos 344 1.3 christos RELOC_NUMBER (R_AARCH64_GOTREL64, 307) 345 1.3 christos RELOC_NUMBER (R_AARCH64_GOTREL32, 308) 346 1.3 christos 347 1.3 christos /* GOT-relative instruction relocations. */ 348 1.3 christos 349 1.3 christos RELOC_NUMBER (R_AARCH64_GOT_LD_PREL19, 309) 350 1.3 christos RELOC_NUMBER (R_AARCH64_LD64_GOTOFF_LO15, 310) 351 1.1 christos RELOC_NUMBER (R_AARCH64_ADR_GOT_PAGE, 311) 352 1.1 christos RELOC_NUMBER (R_AARCH64_LD64_GOT_LO12_NC, 312) 353 1.3 christos RELOC_NUMBER (R_AARCH64_LD64_GOTPAGE_LO15, 313) 354 1.1 christos 355 1.3 christos /* General Dynamic TLS relocations. */ 356 1.1 christos 357 1.3 christos RELOC_NUMBER (R_AARCH64_TLSGD_ADR_PREL21, 512) 358 1.1 christos RELOC_NUMBER (R_AARCH64_TLSGD_ADR_PAGE21, 513) 359 1.1 christos RELOC_NUMBER (R_AARCH64_TLSGD_ADD_LO12_NC, 514) 360 1.3 christos RELOC_NUMBER (R_AARCH64_TLSGD_MOVW_G1, 515) 361 1.3 christos RELOC_NUMBER (R_AARCH64_TLSGD_MOVW_G0_NC, 516) 362 1.3 christos 363 1.3 christos /* Local Dynamic TLS relocations. */ 364 1.3 christos 365 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_ADR_PREL21, 517) 366 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_ADR_PAGE21, 518) 367 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_ADD_LO12_NC, 519) 368 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_MOVW_G1, 520) 369 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_MOVW_G0_NC, 521) 370 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LD_PREL19, 522) 371 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_MOVW_DTPREL_G2, 523) 372 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_MOVW_DTPREL_G1, 524) 373 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, 525) 374 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_MOVW_DTPREL_G0, 526) 375 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, 527) 376 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_ADD_DTPREL_HI12, 528) 377 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_ADD_DTPREL_LO12, 529) 378 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, 530) 379 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST8_DTPREL_LO12, 531) 380 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, 532) 381 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST16_DTPREL_LO12, 533) 382 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, 534) 383 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST32_DTPREL_LO12, 535) 384 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, 536) 385 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST64_DTPREL_LO12, 537) 386 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, 538) 387 1.3 christos 388 1.3 christos /* Initial Exec TLS relocations. */ 389 1.3 christos 390 1.1 christos RELOC_NUMBER (R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, 539) 391 1.1 christos RELOC_NUMBER (R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, 540) 392 1.1 christos RELOC_NUMBER (R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, 541) 393 1.1 christos RELOC_NUMBER (R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, 542) 394 1.1 christos RELOC_NUMBER (R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, 543) 395 1.3 christos 396 1.3 christos /* Local Exec TLS relocations. */ 397 1.3 christos 398 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_MOVW_TPREL_G2, 544) 399 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_MOVW_TPREL_G1, 545) 400 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, 546) 401 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_MOVW_TPREL_G0, 547) 402 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, 548) 403 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_HI12, 549) 404 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_LO12, 550) 405 1.1 christos RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551) 406 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST8_TPREL_LO12, 552) 407 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, 553) 408 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST16_TPREL_LO12, 554) 409 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, 555) 410 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST32_TPREL_LO12, 556) 411 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, 557) 412 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST64_TPREL_LO12, 558) 413 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, 559) 414 1.1 christos 415 1.3 christos /* TLS descriptor relocations. */ 416 1.3 christos 417 1.3 christos RELOC_NUMBER (R_AARCH64_TLSDESC_LD_PREL19, 560) 418 1.1 christos RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PREL21, 561) 419 1.3 christos RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PAGE21, 562) 420 1.6 christos RELOC_NUMBER (R_AARCH64_TLSDESC_LD64_LO12, 563) 421 1.6 christos RELOC_NUMBER (R_AARCH64_TLSDESC_ADD_LO12, 564) 422 1.1 christos RELOC_NUMBER (R_AARCH64_TLSDESC_OFF_G1, 565) 423 1.1 christos RELOC_NUMBER (R_AARCH64_TLSDESC_OFF_G0_NC, 566) 424 1.1 christos RELOC_NUMBER (R_AARCH64_TLSDESC_LDR, 567) 425 1.1 christos RELOC_NUMBER (R_AARCH64_TLSDESC_ADD, 568) 426 1.1 christos RELOC_NUMBER (R_AARCH64_TLSDESC_CALL, 569) 427 1.3 christos 428 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST128_TPREL_LO12, 570) 429 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC, 571) 430 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST128_DTPREL_LO12, 572) 431 1.3 christos RELOC_NUMBER (R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC, 573) 432 1.1 christos 433 1.1 christos /* Dynamic relocations */ 434 1.1 christos 435 1.1 christos /* Copy symbol at runtime. */ 436 1.1 christos RELOC_NUMBER (R_AARCH64_COPY, 1024) 437 1.1 christos 438 1.1 christos /* Create GOT entry. */ 439 1.1 christos RELOC_NUMBER (R_AARCH64_GLOB_DAT, 1025) 440 1.1 christos 441 1.1 christos /* Create PLT entry. */ 442 1.1 christos RELOC_NUMBER (R_AARCH64_JUMP_SLOT, 1026) 443 1.1 christos 444 1.1 christos /* Adjust by program base. */ 445 1.1 christos RELOC_NUMBER (R_AARCH64_RELATIVE, 1027) 446 1.1 christos RELOC_NUMBER (R_AARCH64_TLS_DTPMOD64, 1028) 447 1.1 christos RELOC_NUMBER (R_AARCH64_TLS_DTPREL64, 1029) 448 1.1 christos RELOC_NUMBER (R_AARCH64_TLS_TPREL64, 1030) 449 1.3 christos /* Aliasing relocs are guarded by RELOC_MACROS_GEN_FUNC 450 1.3 christos so that readelf.c won't generate duplicated case 451 1.3 christos statements. */ 452 1.3 christos #ifndef RELOC_MACROS_GEN_FUNC 453 1.3 christos RELOC_NUMBER (R_AARCH64_TLS_DTPMOD, 1028) 454 1.3 christos RELOC_NUMBER (R_AARCH64_TLS_DTPREL, 1029) 455 1.3 christos RELOC_NUMBER (R_AARCH64_TLS_TPREL, 1030) 456 1.3 christos #endif 457 1.1 christos RELOC_NUMBER (R_AARCH64_TLSDESC, 1031) 458 1.3 christos RELOC_NUMBER (R_AARCH64_IRELATIVE, 1032) 459 1.1 christos 460 1.1 christos END_RELOC_NUMBERS (R_AARCH64_end) 461 1.1 christos 462 1.1 christos #endif /* _ELF_AARCH64_H */ 463