X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bfd%2Felfnn-aarch64.c;h=0879db97be80ae76db1034477bc673fb3897f1ae;hb=688b08052051dc8fa4341f9afcdecd0572488047;hp=60a8558e7ee19b5901dafbaf56d9019cd0508767;hpb=cec5225bd81f750984856603755854f0f5796ab1;p=platform%2Fupstream%2Fbinutils.git diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 60a8558..0879db9 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -1,5 +1,5 @@ /* AArch64-specific support for NN-bit ELF. - Copyright 2009-2013 Free Software Foundation, Inc. + Copyright (C) 2009-2014 Free Software Foundation, Inc. Contributed by ARM Ltd. This file is part of BFD, the Binary File Descriptor library. @@ -50,7 +50,7 @@ indicate that foo is thread local and should be accessed via the traditional TLS mechanims. - The relocations R_AARCH64_TLSDESC_{ADR_PAGE,LD64_LO12_NC,ADD_LO12_NC} + The relocations R_AARCH64_TLSDESC_{ADR_PAGE21,LD64_LO12_NC,ADD_LO12_NC} against foo indicate that 'foo' is thread local and should be accessed via a TLS descriptor mechanism. @@ -64,12 +64,12 @@ In the traditional TLS mechanism, the double GOT entry is used to provide the tls_index structure, containing module and offset - entries. The static linker places the relocation R_AARCH64_TLS_DTPMOD64 + entries. The static linker places the relocation R_AARCH64_TLS_DTPMOD on the module entry. The loader will subsequently fixup this relocation with the module identity. For global traditional TLS symbols the static linker places an - R_AARCH64_TLS_DTPREL64 relocation on the offset entry. The loader + R_AARCH64_TLS_DTPREL relocation on the offset entry. The loader will subsequently fixup the offset. For local TLS symbols the static linker fixes up offset. @@ -97,7 +97,7 @@ This function is invoked for each relocation. The TLS relocations R_AARCH64_TLSGD_{ADR_PREL21,ADD_LO12_NC} and - R_AARCH64_TLSDESC_{ADR_PAGE,LD64_LO12_NC,ADD_LO12_NC} are + R_AARCH64_TLSDESC_{ADR_PAGE21,LD64_LO12_NC,ADD_LO12_NC} are spotted. One time creation of local symbol data structures are created when the first local symbol is seen. @@ -142,60 +142,63 @@ #include "bfd_stdint.h" #include "elf-bfd.h" #include "bfdlink.h" +#include "objalloc.h" #include "elf/aarch64.h" +#include "elfxx-aarch64.h" #define ARCH_SIZE NN #if ARCH_SIZE == 64 #define AARCH64_R(NAME) R_AARCH64_ ## NAME #define AARCH64_R_STR(NAME) "R_AARCH64_" #NAME +#define HOWTO64(...) HOWTO (__VA_ARGS__) +#define HOWTO32(...) EMPTY_HOWTO (0) #define LOG_FILE_ALIGN 3 #endif #if ARCH_SIZE == 32 #define AARCH64_R(NAME) R_AARCH64_P32_ ## NAME #define AARCH64_R_STR(NAME) "R_AARCH64_P32_" #NAME +#define HOWTO64(...) EMPTY_HOWTO (0) +#define HOWTO32(...) HOWTO (__VA_ARGS__) #define LOG_FILE_ALIGN 2 #endif -static bfd_reloc_status_type -bfd_elf_aarch64_put_addend (bfd *abfd, - bfd_byte *address, - reloc_howto_type *howto, bfd_signed_vma addend); - -#define IS_AARCH64_TLS_RELOC(R_TYPE) \ - ((R_TYPE) == R_AARCH64_TLSGD_ADR_PAGE21 \ - || (R_TYPE) == R_AARCH64_TLSGD_ADD_LO12_NC \ - || (R_TYPE) == R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 \ - || (R_TYPE) == R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC \ - || (R_TYPE) == R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 \ - || (R_TYPE) == R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC \ - || (R_TYPE) == R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 \ - || (R_TYPE) == R_AARCH64_TLSLE_ADD_TPREL_LO12 \ - || (R_TYPE) == R_AARCH64_TLSLE_ADD_TPREL_HI12 \ - || (R_TYPE) == R_AARCH64_TLSLE_ADD_TPREL_LO12_NC \ - || (R_TYPE) == R_AARCH64_TLSLE_MOVW_TPREL_G2 \ - || (R_TYPE) == R_AARCH64_TLSLE_MOVW_TPREL_G1 \ - || (R_TYPE) == R_AARCH64_TLSLE_MOVW_TPREL_G1_NC \ - || (R_TYPE) == R_AARCH64_TLSLE_MOVW_TPREL_G0 \ - || (R_TYPE) == R_AARCH64_TLSLE_MOVW_TPREL_G0_NC \ - || (R_TYPE) == R_AARCH64_TLS_DTPMOD64 \ - || (R_TYPE) == R_AARCH64_TLS_DTPREL64 \ - || (R_TYPE) == R_AARCH64_TLS_TPREL64 \ +#define IS_AARCH64_TLS_RELOC(R_TYPE) \ + ((R_TYPE) == BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLS_DTPMOD \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLS_DTPREL \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLS_TPREL \ || IS_AARCH64_TLSDESC_RELOC ((R_TYPE))) -#define IS_AARCH64_TLSDESC_RELOC(R_TYPE) \ - ((R_TYPE) == R_AARCH64_TLSDESC_LD_PREL19 \ - || (R_TYPE) == R_AARCH64_TLSDESC_ADR_PREL21 \ - || (R_TYPE) == R_AARCH64_TLSDESC_ADR_PAGE21 \ - || (R_TYPE) == R_AARCH64_TLSDESC_ADD_LO12_NC \ - || (R_TYPE) == R_AARCH64_TLSDESC_LD64_LO12_NC \ - || (R_TYPE) == R_AARCH64_TLSDESC_OFF_G1 \ - || (R_TYPE) == R_AARCH64_TLSDESC_OFF_G0_NC \ - || (R_TYPE) == R_AARCH64_TLSDESC_LDR \ - || (R_TYPE) == R_AARCH64_TLSDESC_ADD \ - || (R_TYPE) == R_AARCH64_TLSDESC_CALL \ - || (R_TYPE) == R_AARCH64_TLSDESC) +#define IS_AARCH64_TLSDESC_RELOC(R_TYPE) \ + ((R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_LD_PREL19 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_OFF_G1 \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_LDR \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_ADD \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC_CALL \ + || (R_TYPE) == BFD_RELOC_AARCH64_TLSDESC) #define ELIMINATE_COPY_RELOCS 0 @@ -209,10 +212,6 @@ bfd_elf_aarch64_put_addend (bfd *abfd, #define PLT_SMALL_ENTRY_SIZE (16) #define PLT_TLSDESC_ENTRY_SIZE (32) -/* Take the PAGE component of an address or offset. */ -#define PG(x) ((x) & ~ 0xfff) -#define PG_OFFSET(x) ((x) & 0xfff) - /* Encoding of the nop instruction */ #define INSN_NOP 0xd503201f @@ -229,8 +228,13 @@ static const bfd_byte elfNN_aarch64_small_plt0_entry[PLT_ENTRY_SIZE] = { 0xf0, 0x7b, 0xbf, 0xa9, /* stp x16, x30, [sp, #-16]! */ 0x10, 0x00, 0x00, 0x90, /* adrp x16, (GOT+16) */ +#if ARCH_SIZE == 64 0x11, 0x0A, 0x40, 0xf9, /* ldr x17, [x16, #PLT_GOT+0x10] */ 0x10, 0x42, 0x00, 0x91, /* add x16, x16,#PLT_GOT+0x10 */ +#else + 0x11, 0x0A, 0x40, 0xb9, /* ldr w17, [x16, #PLT_GOT+0x8] */ + 0x10, 0x22, 0x00, 0x11, /* add w16, w16,#PLT_GOT+0x8 */ +#endif 0x20, 0x02, 0x1f, 0xd6, /* br x17 */ 0x1f, 0x20, 0x03, 0xd5, /* nop */ 0x1f, 0x20, 0x03, 0xd5, /* nop */ @@ -243,8 +247,13 @@ static const bfd_byte elfNN_aarch64_small_plt0_entry[PLT_ENTRY_SIZE] = static const bfd_byte elfNN_aarch64_small_plt_entry[PLT_SMALL_ENTRY_SIZE] = { 0x10, 0x00, 0x00, 0x90, /* adrp x16, PLTGOT + n * 8 */ +#if ARCH_SIZE == 64 0x11, 0x02, 0x40, 0xf9, /* ldr x17, [x16, PLTGOT + n * 8] */ 0x10, 0x02, 0x00, 0x91, /* add x16, x16, :lo12:PLTGOT + n * 8 */ +#else + 0x11, 0x02, 0x40, 0xb9, /* ldr w17, [x16, PLTGOT + n * 4] */ + 0x10, 0x02, 0x00, 0x11, /* add w16, w16, :lo12:PLTGOT + n * 4 */ +#endif 0x20, 0x02, 0x1f, 0xd6, /* br x17. */ }; @@ -254,9 +263,14 @@ elfNN_aarch64_tlsdesc_small_plt_entry[PLT_TLSDESC_ENTRY_SIZE] = 0xe2, 0x0f, 0xbf, 0xa9, /* stp x2, x3, [sp, #-16]! */ 0x02, 0x00, 0x00, 0x90, /* adrp x2, 0 */ 0x03, 0x00, 0x00, 0x90, /* adrp x3, 0 */ - 0x42, 0x08, 0x40, 0xF9, /* ldr x2, [x2, #0] */ +#if ARCH_SIZE == 64 + 0x42, 0x00, 0x40, 0xf9, /* ldr x2, [x2, #0] */ 0x63, 0x00, 0x00, 0x91, /* add x3, x3, 0 */ - 0x40, 0x00, 0x1F, 0xD6, /* br x2 */ +#else + 0x42, 0x00, 0x40, 0xb9, /* ldr w2, [x2, #0] */ + 0x63, 0x00, 0x00, 0x11, /* add w3, w3, 0 */ +#endif + 0x40, 0x00, 0x1f, 0xd6, /* br x2 */ 0x1f, 0x20, 0x03, 0xd5, /* nop */ 0x1f, 0x20, 0x03, 0xd5, /* nop */ }; @@ -269,146 +283,32 @@ elfNN_aarch64_tlsdesc_small_plt_entry[PLT_TLSDESC_ENTRY_SIZE] = /* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */ #define ALL_ONES (~ (bfd_vma) 0) -static reloc_howto_type elf64_aarch64_howto_none = - HOWTO (R_AARCH64_NONE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_NONE", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE); /* pcrel_offset */ +/* Indexed by the bfd interal reloc enumerators. + Therefore, the table needs to be synced with BFD_RELOC_AARCH64_* + in reloc.c. */ -static reloc_howto_type elf64_aarch64_howto_dynrelocs[] = +static reloc_howto_type elfNN_aarch64_howto_table[] = { - HOWTO (R_AARCH64_COPY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_COPY", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_AARCH64_GLOB_DAT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_GLOB_DAT", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_AARCH64_JUMP_SLOT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_JUMP_SLOT", /* name */ - TRUE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_AARCH64_RELATIVE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_RELATIVE", /* name */ - TRUE, /* partial_inplace */ - ALL_ONES, /* src_mask */ - ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_AARCH64_TLS_DTPMOD64, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLS_DTPMOD64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ALL_ONES, /* dst_mask */ - FALSE), /* pc_reloffset */ - - HOWTO (R_AARCH64_TLS_DTPREL64, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLS_DTPREL64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + EMPTY_HOWTO (0), - HOWTO (R_AARCH64_TLS_TPREL64, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLS_TPREL64", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + /* Basic data relocations. */ - HOWTO (R_AARCH64_TLSDESC, /* type */ +#if ARCH_SIZE == 64 + HOWTO (R_AARCH64_NULL, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC", /* name */ + "R_AARCH64_NULL", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ - ALL_ONES, /* dst_mask */ + 0, /* dst_mask */ FALSE), /* pcrel_offset */ - -}; - -/* Note: code such as elf64_aarch64_reloc_type_lookup expect to use e.g. - R_AARCH64_PREL64 as an index into this, and find the R_AARCH64_PREL64 HOWTO - in that slot. */ - -static reloc_howto_type elf64_aarch64_howto_table[] = -{ - /* Basic data relocations. */ - - HOWTO (R_AARCH64_NULL, /* type */ +#else + HOWTO (R_AARCH64_NONE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ @@ -416,14 +316,15 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_NULL", /* name */ + "R_AARCH64_NONE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ +#endif /* .xword: (S+A) */ - HOWTO (R_AARCH64_ABS64, /* type */ + HOWTO64 (AARCH64_R (ABS64), /* type */ 0, /* rightshift */ 4, /* size (4 = long long) */ 64, /* bitsize */ @@ -431,14 +332,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ABS64", /* name */ + AARCH64_R_STR (ABS64), /* name */ FALSE, /* partial_inplace */ ALL_ONES, /* src_mask */ ALL_ONES, /* dst_mask */ FALSE), /* pcrel_offset */ /* .word: (S+A) */ - HOWTO (R_AARCH64_ABS32, /* type */ + HOWTO (AARCH64_R (ABS32), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ @@ -446,14 +347,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ABS32", /* name */ + AARCH64_R_STR (ABS32), /* name */ FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* .half: (S+A) */ - HOWTO (R_AARCH64_ABS16, /* type */ + HOWTO (AARCH64_R (ABS16), /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -461,14 +362,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ABS16", /* name */ + AARCH64_R_STR (ABS16), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* .xword: (S+A-P) */ - HOWTO (R_AARCH64_PREL64, /* type */ + HOWTO64 (AARCH64_R (PREL64), /* type */ 0, /* rightshift */ 4, /* size (4 = long long) */ 64, /* bitsize */ @@ -476,14 +377,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_PREL64", /* name */ + AARCH64_R_STR (PREL64), /* name */ FALSE, /* partial_inplace */ ALL_ONES, /* src_mask */ ALL_ONES, /* dst_mask */ TRUE), /* pcrel_offset */ /* .word: (S+A-P) */ - HOWTO (R_AARCH64_PREL32, /* type */ + HOWTO (AARCH64_R (PREL32), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ @@ -491,14 +392,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_PREL32", /* name */ + AARCH64_R_STR (PREL32), /* name */ FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* .half: (S+A-P) */ - HOWTO (R_AARCH64_PREL16, /* type */ + HOWTO (AARCH64_R (PREL16), /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -506,7 +407,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_PREL16", /* name */ + AARCH64_R_STR (PREL16), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ @@ -516,7 +417,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = unsigned data or abs address inline. */ /* MOVZ: ((S+A) >> 0) & 0xffff */ - HOWTO (R_AARCH64_MOVW_UABS_G0, /* type */ + HOWTO (AARCH64_R (MOVW_UABS_G0), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -524,14 +425,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_UABS_G0", /* name */ + AARCH64_R_STR (MOVW_UABS_G0), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOVK: ((S+A) >> 0) & 0xffff [no overflow check] */ - HOWTO (R_AARCH64_MOVW_UABS_G0_NC, /* type */ + HOWTO (AARCH64_R (MOVW_UABS_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -539,14 +440,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_UABS_G0_NC", /* name */ + AARCH64_R_STR (MOVW_UABS_G0_NC), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOVZ: ((S+A) >> 16) & 0xffff */ - HOWTO (R_AARCH64_MOVW_UABS_G1, /* type */ + HOWTO (AARCH64_R (MOVW_UABS_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -554,14 +455,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_UABS_G1", /* name */ + AARCH64_R_STR (MOVW_UABS_G1), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOVK: ((S+A) >> 16) & 0xffff [no overflow check] */ - HOWTO (R_AARCH64_MOVW_UABS_G1_NC, /* type */ + HOWTO64 (AARCH64_R (MOVW_UABS_G1_NC), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -569,14 +470,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_UABS_G1_NC", /* name */ + AARCH64_R_STR (MOVW_UABS_G1_NC), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOVZ: ((S+A) >> 32) & 0xffff */ - HOWTO (R_AARCH64_MOVW_UABS_G2, /* type */ + HOWTO64 (AARCH64_R (MOVW_UABS_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -584,14 +485,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_UABS_G2", /* name */ + AARCH64_R_STR (MOVW_UABS_G2), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOVK: ((S+A) >> 32) & 0xffff [no overflow check] */ - HOWTO (R_AARCH64_MOVW_UABS_G2_NC, /* type */ + HOWTO64 (AARCH64_R (MOVW_UABS_G2_NC), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -599,14 +500,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_UABS_G2_NC", /* name */ + AARCH64_R_STR (MOVW_UABS_G2_NC), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOVZ: ((S+A) >> 48) & 0xffff */ - HOWTO (R_AARCH64_MOVW_UABS_G3, /* type */ + HOWTO64 (AARCH64_R (MOVW_UABS_G3), /* type */ 48, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -614,7 +515,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_UABS_G3", /* name */ + AARCH64_R_STR (MOVW_UABS_G3), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ @@ -625,7 +526,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = to MOVN or MOVZ depending on sign of calculated value. */ /* MOV[ZN]: ((S+A) >> 0) & 0xffff */ - HOWTO (R_AARCH64_MOVW_SABS_G0, /* type */ + HOWTO (AARCH64_R (MOVW_SABS_G0), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -633,14 +534,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_SABS_G0", /* name */ + AARCH64_R_STR (MOVW_SABS_G0), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOV[ZN]: ((S+A) >> 16) & 0xffff */ - HOWTO (R_AARCH64_MOVW_SABS_G1, /* type */ + HOWTO64 (AARCH64_R (MOVW_SABS_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -648,14 +549,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_SABS_G1", /* name */ + AARCH64_R_STR (MOVW_SABS_G1), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ /* MOV[ZN]: ((S+A) >> 32) & 0xffff */ - HOWTO (R_AARCH64_MOVW_SABS_G2, /* type */ + HOWTO64 (AARCH64_R (MOVW_SABS_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -663,7 +564,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_MOVW_SABS_G2", /* name */ + AARCH64_R_STR (MOVW_SABS_G2), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ @@ -673,7 +574,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = addresses: PG(x) is (x & ~0xfff). */ /* LD-lit: ((S+A-P) >> 2) & 0x7ffff */ - HOWTO (R_AARCH64_LD_PREL_LO19, /* type */ + HOWTO (AARCH64_R (LD_PREL_LO19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ @@ -681,14 +582,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_LD_PREL_LO19", /* name */ + AARCH64_R_STR (LD_PREL_LO19), /* name */ FALSE, /* partial_inplace */ 0x7ffff, /* src_mask */ 0x7ffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* ADR: (S+A-P) & 0x1fffff */ - HOWTO (R_AARCH64_ADR_PREL_LO21, /* type */ + HOWTO (AARCH64_R (ADR_PREL_LO21), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -696,14 +597,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ADR_PREL_LO21", /* name */ + AARCH64_R_STR (ADR_PREL_LO21), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* ADRP: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */ - HOWTO (R_AARCH64_ADR_PREL_PG_HI21, /* type */ + HOWTO (AARCH64_R (ADR_PREL_PG_HI21), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -711,14 +612,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ADR_PREL_PG_HI21", /* name */ + AARCH64_R_STR (ADR_PREL_PG_HI21), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* ADRP: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff [no overflow check] */ - HOWTO (R_AARCH64_ADR_PREL_PG_HI21_NC, /* type */ + HOWTO64 (AARCH64_R (ADR_PREL_PG_HI21_NC), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -726,14 +627,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ADR_PREL_PG_HI21_NC", /* name */ + AARCH64_R_STR (ADR_PREL_PG_HI21_NC), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* ADD: (S+A) & 0xfff [no overflow check] */ - HOWTO (R_AARCH64_ADD_ABS_LO12_NC, /* type */ + HOWTO (AARCH64_R (ADD_ABS_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -741,14 +642,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ADD_ABS_LO12_NC", /* name */ + AARCH64_R_STR (ADD_ABS_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ FALSE), /* pcrel_offset */ /* LD/ST8: (S+A) & 0xfff */ - HOWTO (R_AARCH64_LDST8_ABS_LO12_NC, /* type */ + HOWTO (AARCH64_R (LDST8_ABS_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -756,7 +657,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_LDST8_ABS_LO12_NC", /* name */ + AARCH64_R_STR (LDST8_ABS_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ @@ -765,7 +666,7 @@ static reloc_howto_type elf64_aarch64_howto_table[] = /* Relocations for control-flow instructions. */ /* TBZ/NZ: ((S+A-P) >> 2) & 0x3fff */ - HOWTO (R_AARCH64_TSTBR14, /* type */ + HOWTO (AARCH64_R (TSTBR14), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 14, /* bitsize */ @@ -773,14 +674,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TSTBR14", /* name */ + AARCH64_R_STR (TSTBR14), /* name */ FALSE, /* partial_inplace */ 0x3fff, /* src_mask */ 0x3fff, /* dst_mask */ TRUE), /* pcrel_offset */ /* B.cond: ((S+A-P) >> 2) & 0x7ffff */ - HOWTO (R_AARCH64_CONDBR19, /* type */ + HOWTO (AARCH64_R (CONDBR19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ @@ -788,16 +689,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_CONDBR19", /* name */ + AARCH64_R_STR (CONDBR19), /* name */ FALSE, /* partial_inplace */ 0x7ffff, /* src_mask */ 0x7ffff, /* dst_mask */ TRUE), /* pcrel_offset */ - EMPTY_HOWTO (281), - /* B: ((S+A-P) >> 2) & 0x3ffffff */ - HOWTO (R_AARCH64_JUMP26, /* type */ + HOWTO (AARCH64_R (JUMP26), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ @@ -805,14 +704,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_JUMP26", /* name */ + AARCH64_R_STR (JUMP26), /* name */ FALSE, /* partial_inplace */ 0x3ffffff, /* src_mask */ 0x3ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* BL: ((S+A-P) >> 2) & 0x3ffffff */ - HOWTO (R_AARCH64_CALL26, /* type */ + HOWTO (AARCH64_R (CALL26), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ @@ -820,14 +719,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_CALL26", /* name */ + AARCH64_R_STR (CALL26), /* name */ FALSE, /* partial_inplace */ 0x3ffffff, /* src_mask */ 0x3ffffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* LD/ST16: (S+A) & 0xffe */ - HOWTO (R_AARCH64_LDST16_ABS_LO12_NC, /* type */ + HOWTO (AARCH64_R (LDST16_ABS_LO12_NC), /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -835,14 +734,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_LDST16_ABS_LO12_NC", /* name */ + AARCH64_R_STR (LDST16_ABS_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xffe, /* src_mask */ 0xffe, /* dst_mask */ FALSE), /* pcrel_offset */ /* LD/ST32: (S+A) & 0xffc */ - HOWTO (R_AARCH64_LDST32_ABS_LO12_NC, /* type */ + HOWTO (AARCH64_R (LDST32_ABS_LO12_NC), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -850,14 +749,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_LDST32_ABS_LO12_NC", /* name */ + AARCH64_R_STR (LDST32_ABS_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xffc, /* src_mask */ 0xffc, /* dst_mask */ FALSE), /* pcrel_offset */ /* LD/ST64: (S+A) & 0xff8 */ - HOWTO (R_AARCH64_LDST64_ABS_LO12_NC, /* type */ + HOWTO (AARCH64_R (LDST64_ABS_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -865,27 +764,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_LDST64_ABS_LO12_NC", /* name */ + AARCH64_R_STR (LDST64_ABS_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xff8, /* src_mask */ 0xff8, /* dst_mask */ FALSE), /* pcrel_offset */ - EMPTY_HOWTO (287), - EMPTY_HOWTO (288), - EMPTY_HOWTO (289), - EMPTY_HOWTO (290), - EMPTY_HOWTO (291), - EMPTY_HOWTO (292), - EMPTY_HOWTO (293), - EMPTY_HOWTO (294), - EMPTY_HOWTO (295), - EMPTY_HOWTO (296), - EMPTY_HOWTO (297), - EMPTY_HOWTO (298), - /* LD/ST128: (S+A) & 0xff0 */ - HOWTO (R_AARCH64_LDST128_ABS_LO12_NC, /* type */ + HOWTO (AARCH64_R (LDST128_ABS_LO12_NC), /* type */ 4, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -893,25 +779,15 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_LDST128_ABS_LO12_NC", /* name */ + AARCH64_R_STR (LDST128_ABS_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xff0, /* src_mask */ 0xff0, /* dst_mask */ FALSE), /* pcrel_offset */ - EMPTY_HOWTO (300), - EMPTY_HOWTO (301), - EMPTY_HOWTO (302), - EMPTY_HOWTO (303), - EMPTY_HOWTO (304), - EMPTY_HOWTO (305), - EMPTY_HOWTO (306), - EMPTY_HOWTO (307), - EMPTY_HOWTO (308), - /* Set a load-literal immediate field to bits 0x1FFFFC of G(S)-P */ - HOWTO (R_AARCH64_GOT_LD_PREL19, /* type */ + HOWTO (AARCH64_R (GOT_LD_PREL19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte,1 = short,2 = long) */ 19, /* bitsize */ @@ -919,17 +795,15 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_GOT_LD_PREL19", /* name */ + AARCH64_R_STR (GOT_LD_PREL19), /* name */ FALSE, /* partial_inplace */ 0xffffe0, /* src_mask */ 0xffffe0, /* dst_mask */ TRUE), /* pcrel_offset */ - EMPTY_HOWTO (310), - /* Get to the page for the GOT entry for the symbol (G(S) - P) using an ADRP instruction. */ - HOWTO (R_AARCH64_ADR_GOT_PAGE, /* type */ + HOWTO (AARCH64_R (ADR_GOT_PAGE), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -937,14 +811,14 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_ADR_GOT_PAGE", /* name */ + AARCH64_R_STR (ADR_GOT_PAGE), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ TRUE), /* pcrel_offset */ - /* LDNN: GOT offset G(S) & 0xff8 */ - HOWTO (R_AARCH64_LDNN_GOT_LO12_NC, /* type */ + /* LD64: GOT offset G(S) & 0xff8 */ + HOWTO64 (AARCH64_R (LD64_GOT_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -952,20 +826,30 @@ static reloc_howto_type elf64_aarch64_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_LDNN_GOT_LO12_NC", /* name */ + AARCH64_R_STR (LD64_GOT_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xff8, /* src_mask */ 0xff8, /* dst_mask */ - FALSE) /* pcrel_offset */ -}; + FALSE), /* pcrel_offset */ -static reloc_howto_type elf64_aarch64_tls_howto_table[] = -{ - EMPTY_HOWTO (512), + /* LD32: GOT offset G(S) & 0xffc */ + HOWTO32 (AARCH64_R (LD32_GOT_LO12_NC), /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (LD32_GOT_LO12_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffc, /* src_mask */ + 0xffc, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Get to the page for the GOT entry for the symbol (G(S) - P) using an ADRP instruction. */ - HOWTO (R_AARCH64_TLSGD_ADR_PAGE21, /* type */ + HOWTO (AARCH64_R (TLSGD_ADR_PAGE21), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -973,14 +857,14 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSGD_ADR_PAGE21", /* name */ + AARCH64_R_STR (TLSGD_ADR_PAGE21), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ TRUE), /* pcrel_offset */ /* ADD: GOT offset G(S) & 0xff8 [no overflow check] */ - HOWTO (R_AARCH64_TLSGD_ADD_LO12_NC, /* type */ + HOWTO (AARCH64_R (TLSGD_ADD_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -988,38 +872,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSGD_ADD_LO12_NC", /* name */ + AARCH64_R_STR (TLSGD_ADD_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ FALSE), /* pcrel_offset */ - EMPTY_HOWTO (515), - EMPTY_HOWTO (516), - EMPTY_HOWTO (517), - EMPTY_HOWTO (518), - EMPTY_HOWTO (519), - EMPTY_HOWTO (520), - EMPTY_HOWTO (521), - EMPTY_HOWTO (522), - EMPTY_HOWTO (523), - EMPTY_HOWTO (524), - EMPTY_HOWTO (525), - EMPTY_HOWTO (526), - EMPTY_HOWTO (527), - EMPTY_HOWTO (528), - EMPTY_HOWTO (529), - EMPTY_HOWTO (530), - EMPTY_HOWTO (531), - EMPTY_HOWTO (532), - EMPTY_HOWTO (533), - EMPTY_HOWTO (534), - EMPTY_HOWTO (535), - EMPTY_HOWTO (536), - EMPTY_HOWTO (537), - EMPTY_HOWTO (538), - - HOWTO (R_AARCH64_TLSIE_MOVW_GOTTPREL_G1, /* type */ + HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ @@ -1027,13 +886,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", /* name */ + AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G1), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, /* type */ + HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ @@ -1041,13 +900,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", /* name */ + AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G0_NC), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* type */ + HOWTO (AARCH64_R (TLSIE_ADR_GOTTPREL_PAGE21), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -1055,13 +914,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", /* name */ + AARCH64_R_STR (TLSIE_ADR_GOTTPREL_PAGE21), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* type */ + HOWTO64 (AARCH64_R (TLSIE_LD64_GOTTPREL_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1069,13 +928,27 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", /* name */ + AARCH64_R_STR (TLSIE_LD64_GOTTPREL_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xff8, /* src_mask */ 0xff8, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* type */ + HOWTO32 (AARCH64_R (TLSIE_LD32_GOTTPREL_LO12_NC), /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSIE_LD32_GOTTPREL_LO12_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffc, /* src_mask */ + 0xffc, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (AARCH64_R (TLSIE_LD_GOTTPREL_PREL19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -1083,13 +956,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", /* name */ + AARCH64_R_STR (TLSIE_LD_GOTTPREL_PREL19), /* name */ FALSE, /* partial_inplace */ 0x1ffffc, /* src_mask */ 0x1ffffc, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G2, /* type */ + HOWTO64 (AARCH64_R (TLSLE_MOVW_TPREL_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1097,13 +970,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_MOVW_TPREL_G2", /* name */ + AARCH64_R_STR (TLSLE_MOVW_TPREL_G2), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G1, /* type */ + HOWTO (AARCH64_R (TLSLE_MOVW_TPREL_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1111,13 +984,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_MOVW_TPREL_G1", /* name */ + AARCH64_R_STR (TLSLE_MOVW_TPREL_G1), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, /* type */ + HOWTO64 (AARCH64_R (TLSLE_MOVW_TPREL_G1_NC), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1125,13 +998,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", /* name */ + AARCH64_R_STR (TLSLE_MOVW_TPREL_G1_NC), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G0, /* type */ + HOWTO (AARCH64_R (TLSLE_MOVW_TPREL_G0), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1139,13 +1012,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_MOVW_TPREL_G0", /* name */ + AARCH64_R_STR (TLSLE_MOVW_TPREL_G0), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G0_NC, /* type */ + HOWTO (AARCH64_R (TLSLE_MOVW_TPREL_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1153,13 +1026,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", /* name */ + AARCH64_R_STR (TLSLE_MOVW_TPREL_G0_NC), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_ADD_TPREL_HI12, /* type */ + HOWTO (AARCH64_R (TLSLE_ADD_TPREL_HI12), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1167,13 +1040,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_ADD_TPREL_HI12", /* name */ + AARCH64_R_STR (TLSLE_ADD_TPREL_HI12), /* name */ FALSE, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_ADD_TPREL_LO12, /* type */ + HOWTO (AARCH64_R (TLSLE_ADD_TPREL_LO12), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1181,13 +1054,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_ADD_TPREL_LO12", /* name */ + AARCH64_R_STR (TLSLE_ADD_TPREL_LO12), /* name */ FALSE, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, /* type */ + HOWTO (AARCH64_R (TLSLE_ADD_TPREL_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1195,16 +1068,13 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", /* name */ + AARCH64_R_STR (TLSLE_ADD_TPREL_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ FALSE), /* pcrel_offset */ -}; -static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = -{ - HOWTO (R_AARCH64_TLSDESC_LD_PREL19, /* type */ + HOWTO (AARCH64_R (TLSDESC_LD_PREL19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -1212,13 +1082,13 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_LD_PREL19", /* name */ + AARCH64_R_STR (TLSDESC_LD_PREL19), /* name */ FALSE, /* partial_inplace */ 0x1ffffc, /* src_mask */ 0x1ffffc, /* dst_mask */ TRUE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSDESC_ADR_PREL21, /* type */ + HOWTO (AARCH64_R (TLSDESC_ADR_PREL21), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -1226,7 +1096,7 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_ADR_PREL21", /* name */ + AARCH64_R_STR (TLSDESC_ADR_PREL21), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ @@ -1234,7 +1104,7 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = /* Get to the page for the GOT entry for the symbol (G(S) - P) using an ADRP instruction. */ - HOWTO (R_AARCH64_TLSDESC_ADR_PAGE21, /* type */ + HOWTO (AARCH64_R (TLSDESC_ADR_PAGE21), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ @@ -1242,14 +1112,14 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_ADR_PAGE21", /* name */ + AARCH64_R_STR (TLSDESC_ADR_PAGE21), /* name */ FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ TRUE), /* pcrel_offset */ - /* LD64: GOT offset G(S) & 0xfff. */ - HOWTO (R_AARCH64_TLSDESC_LD64_LO12_NC, /* type */ + /* LD64: GOT offset G(S) & 0xff8. */ + HOWTO64 (AARCH64_R (TLSDESC_LD64_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1257,14 +1127,29 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_LD64_LO12_NC", /* name */ + AARCH64_R_STR (TLSDESC_LD64_LO12_NC), /* name */ FALSE, /* partial_inplace */ - 0xfff, /* src_mask */ - 0xfff, /* dst_mask */ + 0xff8, /* src_mask */ + 0xff8, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* LD32: GOT offset G(S) & 0xffc. */ + HOWTO32 (AARCH64_R (TLSDESC_LD32_LO12_NC), /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSDESC_LD32_LO12_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffc, /* src_mask */ + 0xffc, /* dst_mask */ FALSE), /* pcrel_offset */ /* ADD: GOT offset G(S) & 0xfff. */ - HOWTO (R_AARCH64_TLSDESC_ADD_LO12_NC, /* type */ + HOWTO (AARCH64_R (TLSDESC_ADD_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1272,13 +1157,13 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_ADD_LO12_NC", /* name */ + AARCH64_R_STR (TLSDESC_ADD_LO12_NC), /* name */ FALSE, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSDESC_OFF_G1, /* type */ + HOWTO64 (AARCH64_R (TLSDESC_OFF_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1286,13 +1171,13 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_OFF_G1", /* name */ + AARCH64_R_STR (TLSDESC_OFF_G1), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSDESC_OFF_G0_NC, /* type */ + HOWTO64 (AARCH64_R (TLSDESC_OFF_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1300,13 +1185,13 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_OFF_G0_NC", /* name */ + AARCH64_R_STR (TLSDESC_OFF_G0_NC), /* name */ FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSDESC_LDR, /* type */ + HOWTO64 (AARCH64_R (TLSDESC_LDR), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1314,13 +1199,13 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_LDR", /* name */ + AARCH64_R_STR (TLSDESC_LDR), /* name */ FALSE, /* partial_inplace */ 0x0, /* src_mask */ 0x0, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSDESC_ADD, /* type */ + HOWTO64 (AARCH64_R (TLSDESC_ADD), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1328,13 +1213,13 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_ADD", /* name */ + AARCH64_R_STR (TLSDESC_ADD), /* name */ FALSE, /* partial_inplace */ 0x0, /* src_mask */ 0x0, /* dst_mask */ FALSE), /* pcrel_offset */ - HOWTO (R_AARCH64_TLSDESC_CALL, /* type */ + HOWTO (AARCH64_R (TLSDESC_CALL), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ @@ -1342,231 +1227,332 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] = 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_AARCH64_TLSDESC_CALL", /* name */ + AARCH64_R_STR (TLSDESC_CALL), /* name */ FALSE, /* partial_inplace */ 0x0, /* src_mask */ 0x0, /* dst_mask */ FALSE), /* pcrel_offset */ -}; - -static reloc_howto_type * -elfNN_aarch64_howto_from_type (unsigned int r_type) -{ -#if ARCH_SIZE == 32 - if (r_type > 256) - { - bfd_set_error (bfd_error_bad_value); - return NULL; - } -#endif - - if (r_type >= R_AARCH64_static_min && r_type < R_AARCH64_static_max) - return &elf64_aarch64_howto_table[r_type - R_AARCH64_static_min]; - if (r_type >= R_AARCH64_tls_min && r_type < R_AARCH64_tls_max) - return &elf64_aarch64_tls_howto_table[r_type - R_AARCH64_tls_min]; + HOWTO (AARCH64_R (COPY), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (COPY), /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - if (r_type >= R_AARCH64_tlsdesc_min && r_type < R_AARCH64_tlsdesc_max) - return &elf64_aarch64_tlsdesc_howto_table[r_type - R_AARCH64_tlsdesc_min]; + HOWTO (AARCH64_R (GLOB_DAT), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (GLOB_DAT), /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - if (r_type >= R_AARCH64_dyn_min && r_type < R_AARCH64_dyn_max) - return &elf64_aarch64_howto_dynrelocs[r_type - R_AARCH64_dyn_min]; + HOWTO (AARCH64_R (JUMP_SLOT), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (JUMP_SLOT), /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - switch (r_type) - { - case R_AARCH64_NONE: - return &elf64_aarch64_howto_none; + HOWTO (AARCH64_R (RELATIVE), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (RELATIVE), /* name */ + TRUE, /* partial_inplace */ + ALL_ONES, /* src_mask */ + ALL_ONES, /* dst_mask */ + FALSE), /* pcrel_offset */ - } - bfd_set_error (bfd_error_bad_value); - return NULL; -} + HOWTO (AARCH64_R (TLS_DTPMOD), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ +#if ARCH_SIZE == 64 + AARCH64_R_STR (TLS_DTPMOD64), /* name */ +#else + AARCH64_R_STR (TLS_DTPMOD), /* name */ +#endif + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ALL_ONES, /* dst_mask */ + FALSE), /* pc_reloffset */ -static void -elfNN_aarch64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, - Elf_Internal_Rela *elf_reloc) + HOWTO (AARCH64_R (TLS_DTPREL), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ +#if ARCH_SIZE == 64 + AARCH64_R_STR (TLS_DTPREL64), /* name */ +#else + AARCH64_R_STR (TLS_DTPREL), /* name */ +#endif + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ALL_ONES, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (AARCH64_R (TLS_TPREL), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ +#if ARCH_SIZE == 64 + AARCH64_R_STR (TLS_TPREL64), /* name */ +#else + AARCH64_R_STR (TLS_TPREL), /* name */ +#endif + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ALL_ONES, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (AARCH64_R (TLSDESC), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (TLSDESC), /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ALL_ONES, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (AARCH64_R (IRELATIVE), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (IRELATIVE), /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ALL_ONES, /* dst_mask */ + FALSE), /* pcrel_offset */ + + EMPTY_HOWTO (0), +}; + +static reloc_howto_type elfNN_aarch64_howto_none = + HOWTO (R_AARCH64_NONE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AARCH64_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE); /* pcrel_offset */ + +/* Given HOWTO, return the bfd internal relocation enumerator. */ + +static bfd_reloc_code_real_type +elfNN_aarch64_bfd_reloc_from_howto (reloc_howto_type *howto) { - unsigned int r_type; + const int size + = (int) ARRAY_SIZE (elfNN_aarch64_howto_table); + const ptrdiff_t offset + = howto - elfNN_aarch64_howto_table; - r_type = ELFNN_R_TYPE (elf_reloc->r_info); - bfd_reloc->howto = elfNN_aarch64_howto_from_type (r_type); + if (offset > 0 && offset < size - 1) + return BFD_RELOC_AARCH64_RELOC_START + offset; + + if (howto == &elfNN_aarch64_howto_none) + return BFD_RELOC_AARCH64_NONE; + + return BFD_RELOC_AARCH64_RELOC_START; +} + +/* Given R_TYPE, return the bfd internal relocation enumerator. */ + +static bfd_reloc_code_real_type +elfNN_aarch64_bfd_reloc_from_type (unsigned int r_type) +{ + static bfd_boolean initialized_p = FALSE; + /* Indexed by R_TYPE, values are offsets in the howto_table. */ + static unsigned int offsets[R_AARCH64_end]; + + if (initialized_p == FALSE) + { + unsigned int i; + + for (i = 1; i < ARRAY_SIZE (elfNN_aarch64_howto_table) - 1; ++i) + if (elfNN_aarch64_howto_table[i].type != 0) + offsets[elfNN_aarch64_howto_table[i].type] = i; + + initialized_p = TRUE; + } + + if (r_type == R_AARCH64_NONE || r_type == R_AARCH64_NULL) + return BFD_RELOC_AARCH64_NONE; + + return BFD_RELOC_AARCH64_RELOC_START + offsets[r_type]; } -struct elf64_aarch64_reloc_map +struct elf_aarch64_reloc_map { - bfd_reloc_code_real_type bfd_reloc_val; - unsigned int elf_reloc_val; + bfd_reloc_code_real_type from; + bfd_reloc_code_real_type to; }; -/* All entries in this list must also be present in - elf64_aarch64_howto_table. */ -static const struct elf64_aarch64_reloc_map elf64_aarch64_reloc_map[] = +/* Map bfd generic reloc to AArch64-specific reloc. */ +static const struct elf_aarch64_reloc_map elf_aarch64_reloc_map[] = { - {BFD_RELOC_NONE, R_AARCH64_NONE}, + {BFD_RELOC_NONE, BFD_RELOC_AARCH64_NONE}, /* Basic data relocations. */ - {BFD_RELOC_CTOR, R_AARCH64_ABS64}, - {BFD_RELOC_64, R_AARCH64_ABS64}, - {BFD_RELOC_32, R_AARCH64_ABS32}, - {BFD_RELOC_16, R_AARCH64_ABS16}, - {BFD_RELOC_64_PCREL, R_AARCH64_PREL64}, - {BFD_RELOC_32_PCREL, R_AARCH64_PREL32}, - {BFD_RELOC_16_PCREL, R_AARCH64_PREL16}, - - /* Group relocations to low order bits of a 16, 32, 48 or 64 bit - value inline. */ - {BFD_RELOC_AARCH64_MOVW_G0_NC, R_AARCH64_MOVW_UABS_G0_NC}, - {BFD_RELOC_AARCH64_MOVW_G1_NC, R_AARCH64_MOVW_UABS_G1_NC}, - {BFD_RELOC_AARCH64_MOVW_G2_NC, R_AARCH64_MOVW_UABS_G2_NC}, - - /* Group relocations to create high bits of a 16, 32, 48 or 64 bit - signed value inline. */ - {BFD_RELOC_AARCH64_MOVW_G0_S, R_AARCH64_MOVW_SABS_G0}, - {BFD_RELOC_AARCH64_MOVW_G1_S, R_AARCH64_MOVW_SABS_G1}, - {BFD_RELOC_AARCH64_MOVW_G2_S, R_AARCH64_MOVW_SABS_G2}, - - /* Group relocations to create high bits of a 16, 32, 48 or 64 bit - unsigned value inline. */ - {BFD_RELOC_AARCH64_MOVW_G0, R_AARCH64_MOVW_UABS_G0}, - {BFD_RELOC_AARCH64_MOVW_G1, R_AARCH64_MOVW_UABS_G1}, - {BFD_RELOC_AARCH64_MOVW_G2, R_AARCH64_MOVW_UABS_G2}, - {BFD_RELOC_AARCH64_MOVW_G3, R_AARCH64_MOVW_UABS_G3}, - - /* Relocations to generate 19, 21 and 33 bit PC-relative load/store. */ - {BFD_RELOC_AARCH64_LD_LO19_PCREL, R_AARCH64_LD_PREL_LO19}, - {BFD_RELOC_AARCH64_ADR_LO21_PCREL, R_AARCH64_ADR_PREL_LO21}, - {BFD_RELOC_AARCH64_ADR_HI21_PCREL, R_AARCH64_ADR_PREL_PG_HI21}, - {BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, R_AARCH64_ADR_PREL_PG_HI21_NC}, - {BFD_RELOC_AARCH64_ADD_LO12, R_AARCH64_ADD_ABS_LO12_NC}, - {BFD_RELOC_AARCH64_LDST8_LO12, R_AARCH64_LDST8_ABS_LO12_NC}, - {BFD_RELOC_AARCH64_LDST16_LO12, R_AARCH64_LDST16_ABS_LO12_NC}, - {BFD_RELOC_AARCH64_LDST32_LO12, R_AARCH64_LDST32_ABS_LO12_NC}, - {BFD_RELOC_AARCH64_LDST64_LO12, R_AARCH64_LDST64_ABS_LO12_NC}, - {BFD_RELOC_AARCH64_LDST128_LO12, R_AARCH64_LDST128_ABS_LO12_NC}, - - /* Relocations for control-flow instructions. */ - {BFD_RELOC_AARCH64_TSTBR14, R_AARCH64_TSTBR14}, - {BFD_RELOC_AARCH64_BRANCH19, R_AARCH64_CONDBR19}, - {BFD_RELOC_AARCH64_JUMP26, R_AARCH64_JUMP26}, - {BFD_RELOC_AARCH64_CALL26, R_AARCH64_CALL26}, - - /* Relocations for PIC. */ - {BFD_RELOC_AARCH64_GOT_LD_PREL19, R_AARCH64_GOT_LD_PREL19}, - {BFD_RELOC_AARCH64_ADR_GOT_PAGE, R_AARCH64_ADR_GOT_PAGE}, - {BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, R_AARCH64_LD64_GOT_LO12_NC}, - - /* Relocations for TLS. */ - {BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, R_AARCH64_TLSGD_ADR_PAGE21}, - {BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, R_AARCH64_TLSGD_ADD_LO12_NC}, - {BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, - R_AARCH64_TLSIE_MOVW_GOTTPREL_G1}, - {BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, - R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC}, - {BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, - R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21}, - {BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, - R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC}, - {BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, - R_AARCH64_TLSIE_LD_GOTTPREL_PREL19}, - {BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, R_AARCH64_TLSLE_MOVW_TPREL_G2}, - {BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, R_AARCH64_TLSLE_MOVW_TPREL_G1}, - {BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, - R_AARCH64_TLSLE_MOVW_TPREL_G1_NC}, - {BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, R_AARCH64_TLSLE_MOVW_TPREL_G0}, - {BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, - R_AARCH64_TLSLE_MOVW_TPREL_G0_NC}, - {BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12, R_AARCH64_TLSLE_ADD_TPREL_LO12}, - {BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, R_AARCH64_TLSLE_ADD_TPREL_HI12}, - {BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, - R_AARCH64_TLSLE_ADD_TPREL_LO12_NC}, - {BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, R_AARCH64_TLSDESC_LD_PREL19}, - {BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, R_AARCH64_TLSDESC_ADR_PREL21}, - {BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, R_AARCH64_TLSDESC_ADR_PAGE21}, - {BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, R_AARCH64_TLSDESC_ADD_LO12_NC}, - {BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, R_AARCH64_TLSDESC_LD64_LO12_NC}, - {BFD_RELOC_AARCH64_TLSDESC_OFF_G1, R_AARCH64_TLSDESC_OFF_G1}, - {BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, R_AARCH64_TLSDESC_OFF_G0_NC}, - {BFD_RELOC_AARCH64_TLSDESC_LDR, R_AARCH64_TLSDESC_LDR}, - {BFD_RELOC_AARCH64_TLSDESC_ADD, R_AARCH64_TLSDESC_ADD}, - {BFD_RELOC_AARCH64_TLSDESC_CALL, R_AARCH64_TLSDESC_CALL}, - {BFD_RELOC_AARCH64_TLS_DTPMOD64, R_AARCH64_TLS_DTPMOD64}, - {BFD_RELOC_AARCH64_TLS_DTPREL64, R_AARCH64_TLS_DTPREL64}, - {BFD_RELOC_AARCH64_TLS_TPREL64, R_AARCH64_TLS_TPREL64}, - {BFD_RELOC_AARCH64_TLSDESC, R_AARCH64_TLSDESC}, + {BFD_RELOC_CTOR, BFD_RELOC_AARCH64_NN}, + {BFD_RELOC_64, BFD_RELOC_AARCH64_64}, + {BFD_RELOC_32, BFD_RELOC_AARCH64_32}, + {BFD_RELOC_16, BFD_RELOC_AARCH64_16}, + {BFD_RELOC_64_PCREL, BFD_RELOC_AARCH64_64_PCREL}, + {BFD_RELOC_32_PCREL, BFD_RELOC_AARCH64_32_PCREL}, + {BFD_RELOC_16_PCREL, BFD_RELOC_AARCH64_16_PCREL}, }; +/* Given the bfd internal relocation enumerator in CODE, return the + corresponding howto entry. */ + static reloc_howto_type * -elfNN_aarch64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, - bfd_reloc_code_real_type code) +elfNN_aarch64_howto_from_bfd_reloc (bfd_reloc_code_real_type code) { unsigned int i; - for (i = 0; i < ARRAY_SIZE (elf64_aarch64_reloc_map); i++) - if (elf64_aarch64_reloc_map[i].bfd_reloc_val == code) - return elf64_aarch64_howto_from_type - (elf64_aarch64_reloc_map[i].elf_reloc_val); + /* Convert bfd generic reloc to AArch64-specific reloc. */ + if (code < BFD_RELOC_AARCH64_RELOC_START + || code > BFD_RELOC_AARCH64_RELOC_END) + for (i = 0; i < ARRAY_SIZE (elf_aarch64_reloc_map); i++) + if (elf_aarch64_reloc_map[i].from == code) + { + code = elf_aarch64_reloc_map[i].to; + break; + } + + if (code > BFD_RELOC_AARCH64_RELOC_START + && code < BFD_RELOC_AARCH64_RELOC_END) + if (elfNN_aarch64_howto_table[code - BFD_RELOC_AARCH64_RELOC_START].type) + return &elfNN_aarch64_howto_table[code - BFD_RELOC_AARCH64_RELOC_START]; + + if (code == BFD_RELOC_AARCH64_NONE) + return &elfNN_aarch64_howto_none; - bfd_set_error (bfd_error_bad_value); return NULL; } static reloc_howto_type * -elfNN_aarch64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, - const char *r_name) +elfNN_aarch64_howto_from_type (unsigned int r_type) { - unsigned int i; + bfd_reloc_code_real_type val; + reloc_howto_type *howto; + +#if ARCH_SIZE == 32 + if (r_type > 256) + { + bfd_set_error (bfd_error_bad_value); + return NULL; + } +#endif + + if (r_type == R_AARCH64_NONE) + return &elfNN_aarch64_howto_none; - for (i = 0; i < ARRAY_SIZE (elf64_aarch64_howto_table); i++) - if (elf64_aarch64_howto_table[i].name != NULL - && strcasecmp (elf64_aarch64_howto_table[i].name, r_name) == 0) - return &elf64_aarch64_howto_table[i]; + val = elfNN_aarch64_bfd_reloc_from_type (r_type); + howto = elfNN_aarch64_howto_from_bfd_reloc (val); + if (howto != NULL) + return howto; + + bfd_set_error (bfd_error_bad_value); return NULL; } -/* Support for core dump NOTE sections. */ - -static bfd_boolean -elf64_aarch64_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) +static void +elfNN_aarch64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, + Elf_Internal_Rela *elf_reloc) { - int offset; - size_t size; + unsigned int r_type; - switch (note->descsz) - { - default: - return FALSE; + r_type = ELFNN_R_TYPE (elf_reloc->r_info); + bfd_reloc->howto = elfNN_aarch64_howto_from_type (r_type); +} + +static reloc_howto_type * +elfNN_aarch64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + reloc_howto_type *howto = elfNN_aarch64_howto_from_bfd_reloc (code); - case 408: /* sizeof(struct elf_prstatus) on Linux/arm64. */ - /* pr_cursig */ - elf_tdata (abfd)->core->signal - = bfd_get_16 (abfd, note->descdata + 12); + if (howto != NULL) + return howto; - /* pr_pid */ - elf_tdata (abfd)->core->lwpid - = bfd_get_32 (abfd, note->descdata + 32); + bfd_set_error (bfd_error_bad_value); + return NULL; +} - /* pr_reg */ - offset = 112; - size = 272; +static reloc_howto_type * +elfNN_aarch64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, + const char *r_name) +{ + unsigned int i; - break; - } + for (i = 1; i < ARRAY_SIZE (elfNN_aarch64_howto_table) - 1; ++i) + if (elfNN_aarch64_howto_table[i].name != NULL + && strcasecmp (elfNN_aarch64_howto_table[i].name, r_name) == 0) + return &elfNN_aarch64_howto_table[i]; - /* Make a ".reg/999" section. */ - return _bfd_elfcore_make_pseudosection (abfd, ".reg", - size, note->descpos + offset); + return NULL; } -#define TARGET_LITTLE_SYM bfd_elfNN_littleaarch64_vec +#define TARGET_LITTLE_SYM aarch64_elfNN_le_vec #define TARGET_LITTLE_NAME "elfNN-littleaarch64" -#define TARGET_BIG_SYM bfd_elfNN_bigaarch64_vec +#define TARGET_BIG_SYM aarch64_elfNN_be_vec #define TARGET_BIG_NAME "elfNN-bigaarch64" -#define elf_backend_grok_prstatus elf64_aarch64_grok_prstatus - -typedef unsigned long int insn32; - /* The linker script knows the section names for placement. The entry_names are used to do simple name mangling on the stubs. Given a function name, and its type, the stub can be found. The @@ -1625,6 +1611,12 @@ static const uint32_t aarch64_long_branch_stub[] = 0x00000000, }; +static const uint32_t aarch64_erratum_835769_stub[] = +{ + 0x00000000, /* Placeholder for multiply accumulate. */ + 0x14000000, /* b