X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felfnn-aarch64.c;h=b6f083e430bb51e6930d4663f60362079101511c;hb=7350820d0ddb74f131ffb66b71fb218987f94fa8;hp=5fabcd8f6462730aef10ec942b594d589759994e;hpb=b3adc24a0713411ab38a21dc894dd40dbc5c8f4f;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index 5fabcd8f64..b6f083e430 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -1,5 +1,5 @@ /* AArch64-specific support for NN-bit ELF. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. Contributed by ARM Ltd. This file is part of BFD, the Binary File Descriptor library. @@ -444,118 +444,118 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0, /* rightshift */ 3, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_AARCH64_NULL", /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (R_AARCH64_NONE, /* type */ 0, /* rightshift */ 3, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_AARCH64_NONE", /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* .xword: (S+A) */ HOWTO64 (AARCH64_R (ABS64), /* type */ 0, /* rightshift */ 4, /* size (4 = long long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ABS64), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ ALL_ONES, /* src_mask */ ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* .word: (S+A) */ HOWTO (AARCH64_R (ABS32), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ABS32), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* .half: (S+A) */ HOWTO (AARCH64_R (ABS16), /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ABS16), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* .xword: (S+A-P) */ HOWTO64 (AARCH64_R (PREL64), /* type */ 0, /* rightshift */ 4, /* size (4 = long long) */ 64, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (PREL64), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ ALL_ONES, /* src_mask */ ALL_ONES, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* .word: (S+A-P) */ HOWTO (AARCH64_R (PREL32), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (PREL32), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* .half: (S+A-P) */ HOWTO (AARCH64_R (PREL16), /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (PREL16), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* Group relocations to create a 16, 32, 48 or 64 bit unsigned data or abs address inline. */ @@ -565,105 +565,105 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_UABS_G0), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVK: ((S+A) >> 0) & 0xffff [no overflow check] */ HOWTO (AARCH64_R (MOVW_UABS_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_UABS_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVZ: ((S+A) >> 16) & 0xffff */ HOWTO (AARCH64_R (MOVW_UABS_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_UABS_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVK: ((S+A) >> 16) & 0xffff [no overflow check] */ HOWTO64 (AARCH64_R (MOVW_UABS_G1_NC), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_UABS_G1_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVZ: ((S+A) >> 32) & 0xffff */ HOWTO64 (AARCH64_R (MOVW_UABS_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_UABS_G2), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVK: ((S+A) >> 32) & 0xffff [no overflow check] */ HOWTO64 (AARCH64_R (MOVW_UABS_G2_NC), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_UABS_G2_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVZ: ((S+A) >> 48) & 0xffff */ HOWTO64 (AARCH64_R (MOVW_UABS_G3), /* type */ 48, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_UABS_G3), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Group relocations to create high part of a 16, 32, 48 or 64 bit signed data or abs address inline. Will change instruction @@ -674,45 +674,45 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 17, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_SABS_G0), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOV[ZN]: ((S+A) >> 16) & 0xffff */ HOWTO64 (AARCH64_R (MOVW_SABS_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 17, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_SABS_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOV[ZN]: ((S+A) >> 32) & 0xffff */ HOWTO64 (AARCH64_R (MOVW_SABS_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 17, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_SABS_G2), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Group relocations to create a 16, 32, 48 or 64 bit PC relative address inline. */ @@ -722,105 +722,105 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 17, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_PREL_G0), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* MOVK: ((S+A-P) >> 0) & 0xffff [no overflow check] */ HOWTO (AARCH64_R (MOVW_PREL_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_PREL_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* MOV[NZ]: ((S+A-P) >> 16) & 0xffff */ HOWTO (AARCH64_R (MOVW_PREL_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 17, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_PREL_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* MOVK: ((S+A-P) >> 16) & 0xffff [no overflow check] */ HOWTO64 (AARCH64_R (MOVW_PREL_G1_NC), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_PREL_G1_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* MOV[NZ]: ((S+A-P) >> 32) & 0xffff */ HOWTO64 (AARCH64_R (MOVW_PREL_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 17, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_PREL_G2), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* MOVK: ((S+A-P) >> 32) & 0xffff [no overflow check] */ HOWTO64 (AARCH64_R (MOVW_PREL_G2_NC), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_PREL_G2_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* MOV[NZ]: ((S+A-P) >> 48) & 0xffff */ HOWTO64 (AARCH64_R (MOVW_PREL_G3), /* type */ 48, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_PREL_G3), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* Relocations to generate 19, 21 and 33 bit PC-relative load/store addresses: PG(x) is (x & ~0xfff). */ @@ -830,90 +830,90 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LD_PREL_LO19), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x7ffff, /* src_mask */ 0x7ffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* ADR: (S+A-P) & 0x1fffff */ HOWTO (AARCH64_R (ADR_PREL_LO21), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ADR_PREL_LO21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* ADRP: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff */ HOWTO (AARCH64_R (ADR_PREL_PG_HI21), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ADR_PREL_PG_HI21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* ADRP: ((PG(S+A)-PG(P)) >> 12) & 0x1fffff [no overflow check] */ HOWTO64 (AARCH64_R (ADR_PREL_PG_HI21_NC), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ADR_PREL_PG_HI21_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* ADD: (S+A) & 0xfff [no overflow check] */ HOWTO (AARCH64_R (ADD_ABS_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ADD_ABS_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST8: (S+A) & 0xfff */ HOWTO (AARCH64_R (LDST8_ABS_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LDST8_ABS_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Relocations for control-flow instructions. */ @@ -922,120 +922,120 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 14, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TSTBR14), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3fff, /* src_mask */ 0x3fff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* B.cond: ((S+A-P) >> 2) & 0x7ffff */ HOWTO (AARCH64_R (CONDBR19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (CONDBR19), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x7ffff, /* src_mask */ 0x7ffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* B: ((S+A-P) >> 2) & 0x3ffffff */ HOWTO (AARCH64_R (JUMP26), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (JUMP26), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffffff, /* src_mask */ 0x3ffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* BL: ((S+A-P) >> 2) & 0x3ffffff */ HOWTO (AARCH64_R (CALL26), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (CALL26), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffffff, /* src_mask */ 0x3ffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* LD/ST16: (S+A) & 0xffe */ HOWTO (AARCH64_R (LDST16_ABS_LO12_NC), /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LDST16_ABS_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffe, /* src_mask */ 0xffe, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST32: (S+A) & 0xffc */ HOWTO (AARCH64_R (LDST32_ABS_LO12_NC), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LDST32_ABS_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffc, /* src_mask */ 0xffc, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST64: (S+A) & 0xff8 */ HOWTO (AARCH64_R (LDST64_ABS_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LDST64_ABS_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xff8, /* src_mask */ 0xff8, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST128: (S+A) & 0xff0 */ HOWTO (AARCH64_R (LDST128_ABS_LO12_NC), /* type */ 4, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LDST128_ABS_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xff0, /* src_mask */ 0xff0, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Set a load-literal immediate field to bits 0x1FFFFC of G(S)-P */ @@ -1043,15 +1043,15 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 2, /* rightshift */ 2, /* size (0 = byte,1 = short,2 = long) */ 19, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (GOT_LD_PREL19), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffffe0, /* src_mask */ 0xffffe0, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* Get to the page for the GOT entry for the symbol (G(S) - P) using an ADRP instruction. */ @@ -1059,90 +1059,90 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (ADR_GOT_PAGE), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* 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 */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LD64_GOT_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xff8, /* src_mask */ 0xff8, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* 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 */ + 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 */ + false, /* partial_inplace */ 0xffc, /* src_mask */ 0xffc, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Lower 16 bits of GOT offset for the symbol. */ HOWTO64 (AARCH64_R (MOVW_GOTOFF_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_GOTOFF_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Higher 16 bits of GOT offset for the symbol. */ HOWTO64 (AARCH64_R (MOVW_GOTOFF_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (MOVW_GOTOFF_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD64: GOT offset for the symbol. */ HOWTO64 (AARCH64_R (LD64_GOTOFF_LO15), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LD64_GOTOFF_LO15), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x7ff8, /* src_mask */ 0x7ff8, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD32: GOT offset to the page address of GOT table. (G(S) - PAGE (_GLOBAL_OFFSET_TABLE_)) & 0x5ffc. */ @@ -1150,15 +1150,15 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LD32_GOTPAGE_LO14), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x5ffc, /* src_mask */ 0x5ffc, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD64: GOT offset to the page address of GOT table. (G(S) - PAGE (_GLOBAL_OFFSET_TABLE_)) & 0x7ff8. */ @@ -1166,15 +1166,15 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (LD64_GOTPAGE_LO15), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x7ff8, /* src_mask */ 0x7ff8, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Get to the page for the GOT entry for the symbol (G(S) - P) using an ADRP instruction. */ @@ -1182,218 +1182,218 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSGD_ADR_PAGE21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ HOWTO (AARCH64_R (TLSGD_ADR_PREL21), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSGD_ADR_PREL21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* ADD: GOT offset G(S) & 0xff8 [no overflow check] */ HOWTO (AARCH64_R (TLSGD_ADD_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSGD_ADD_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Lower 16 bits of GOT offset to tls_index. */ HOWTO64 (AARCH64_R (TLSGD_MOVW_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSGD_MOVW_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Higher 16 bits of GOT offset to tls_index. */ HOWTO64 (AARCH64_R (TLSGD_MOVW_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSGD_MOVW_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSIE_ADR_GOTTPREL_PAGE21), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSIE_ADR_GOTTPREL_PAGE21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSIE_LD64_GOTTPREL_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSIE_LD64_GOTTPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xff8, /* src_mask */ 0xff8, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO32 (AARCH64_R (TLSIE_LD32_GOTTPREL_LO12_NC), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + 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 */ + false, /* partial_inplace */ 0xffc, /* src_mask */ 0xffc, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSIE_LD_GOTTPREL_PREL19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSIE_LD_GOTTPREL_PREL19), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1ffffc, /* src_mask */ 0x1ffffc, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* ADD: bit[23:12] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLD_ADD_DTPREL_HI12), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_ADD_DTPREL_HI12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Unsigned 12 bit byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLD_ADD_DTPREL_LO12), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_ADD_DTPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ HOWTO (AARCH64_R (TLSLD_ADD_DTPREL_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_ADD_DTPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* ADD: GOT offset G(S) & 0xff8 [no overflow check] */ HOWTO (AARCH64_R (TLSLD_ADD_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_ADD_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Get to the page for the GOT entry for the symbol (G(S) - P) using an ADRP instruction. */ @@ -1401,484 +1401,484 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_ADR_PAGE21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ HOWTO (AARCH64_R (TLSLD_ADR_PREL21), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_ADR_PREL21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* LD/ST16: bit[11:1] of byte offset to module TLS base address. */ HOWTO64 (AARCH64_R (TLSLD_LDST16_DTPREL_LO12), /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 11, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST16_DTPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1ffc00, /* src_mask */ 0x1ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ HOWTO64 (AARCH64_R (TLSLD_LDST16_DTPREL_LO12_NC), /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 11, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST16_DTPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1ffc00, /* src_mask */ 0x1ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST32: bit[11:2] of byte offset to module TLS base address. */ HOWTO64 (AARCH64_R (TLSLD_LDST32_DTPREL_LO12), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 10, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST32_DTPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ HOWTO64 (AARCH64_R (TLSLD_LDST32_DTPREL_LO12_NC), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 10, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST32_DTPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffc00, /* src_mask */ 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST64: bit[11:3] of byte offset to module TLS base address. */ HOWTO64 (AARCH64_R (TLSLD_LDST64_DTPREL_LO12), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 9, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST64_DTPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ HOWTO64 (AARCH64_R (TLSLD_LDST64_DTPREL_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 9, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST64_DTPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x7fc00, /* src_mask */ 0x7fc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST8: bit[11:0] of byte offset to module TLS base address. */ HOWTO64 (AARCH64_R (TLSLD_LDST8_DTPREL_LO12), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST8_DTPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ HOWTO64 (AARCH64_R (TLSLD_LDST8_DTPREL_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_LDST8_DTPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVZ: bit[15:0] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLD_MOVW_DTPREL_G0), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_MOVW_DTPREL_G0), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0. */ HOWTO (AARCH64_R (TLSLD_MOVW_DTPREL_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_MOVW_DTPREL_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVZ: bit[31:16] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLD_MOVW_DTPREL_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_MOVW_DTPREL_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1. */ HOWTO64 (AARCH64_R (TLSLD_MOVW_DTPREL_G1_NC), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_MOVW_DTPREL_G1_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* MOVZ: bit[47:32] of byte offset to module TLS base address. */ HOWTO64 (AARCH64_R (TLSLD_MOVW_DTPREL_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLD_MOVW_DTPREL_G2), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSLE_MOVW_TPREL_G2), /* type */ 32, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_MOVW_TPREL_G2), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSLE_MOVW_TPREL_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_MOVW_TPREL_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSLE_MOVW_TPREL_G1_NC), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_MOVW_TPREL_G1_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSLE_MOVW_TPREL_G0), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_MOVW_TPREL_G0), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSLE_MOVW_TPREL_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_MOVW_TPREL_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSLE_ADD_TPREL_HI12), /* type */ 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_ADD_TPREL_HI12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSLE_ADD_TPREL_LO12), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_ADD_TPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSLE_ADD_TPREL_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_ADD_TPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST16: bit[11:1] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLE_LDST16_TPREL_LO12), /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 11, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST16_TPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1ffc00, /* src_mask */ 0x1ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ HOWTO (AARCH64_R (TLSLE_LDST16_TPREL_LO12_NC), /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 11, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST16_TPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1ffc00, /* src_mask */ 0x1ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST32: bit[11:2] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLE_LDST32_TPREL_LO12), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 10, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST32_TPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffc00, /* src_mask */ 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ HOWTO (AARCH64_R (TLSLE_LDST32_TPREL_LO12_NC), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 10, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST32_TPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffc00, /* src_mask */ 0xffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST64: bit[11:3] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLE_LDST64_TPREL_LO12), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 9, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST64_TPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x7fc00, /* src_mask */ 0x7fc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ HOWTO (AARCH64_R (TLSLE_LDST64_TPREL_LO12_NC), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 9, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST64_TPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x7fc00, /* src_mask */ 0x7fc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* LD/ST8: bit[11:0] of byte offset to module TLS base address. */ HOWTO (AARCH64_R (TLSLE_LDST8_TPREL_LO12), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST8_TPREL_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* Same as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ HOWTO (AARCH64_R (TLSLE_LDST8_TPREL_LO12_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 10, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSLE_LDST8_TPREL_LO12_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x3ffc00, /* src_mask */ 0x3ffc00, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSDESC_LD_PREL19), /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 19, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_LD_PREL19), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x0ffffe0, /* src_mask */ 0x0ffffe0, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ HOWTO (AARCH64_R (TLSDESC_ADR_PREL21), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_ADR_PREL21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* Get to the page for the GOT entry for the symbol (G(S) - P) using an ADRP instruction. */ @@ -1886,192 +1886,192 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 12, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - TRUE, /* pc_relative */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_ADR_PAGE21), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + true), /* pcrel_offset */ /* LD64: GOT offset G(S) & 0xff8. */ HOWTO64 (AARCH64_R (TLSDESC_LD64_LO12), /* type */ 3, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_LD64_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xff8, /* src_mask */ 0xff8, /* dst_mask */ - FALSE), /* pcrel_offset */ + 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 */ + 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 */ + false, /* partial_inplace */ 0xffc, /* src_mask */ 0xffc, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ /* ADD: GOT offset G(S) & 0xfff. */ HOWTO (AARCH64_R (TLSDESC_ADD_LO12), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_ADD_LO12), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xfff, /* src_mask */ 0xfff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSDESC_OFF_G1), /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_unsigned, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_OFF_G1), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSDESC_OFF_G0_NC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_OFF_G0_NC), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSDESC_LDR), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_LDR), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x0, /* src_mask */ 0x0, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO64 (AARCH64_R (TLSDESC_ADD), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_ADD), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x0, /* src_mask */ 0x0, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSDESC_CALL), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ AARCH64_R_STR (TLSDESC_CALL), /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0x0, /* src_mask */ 0x0, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (COPY), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + 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 */ + true, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (GLOB_DAT), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + 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 */ + true, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (JUMP_SLOT), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + 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 */ + true, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (RELATIVE), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + 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 */ + true, /* partial_inplace */ ALL_ONES, /* src_mask */ ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLS_DTPMOD), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ @@ -2080,16 +2080,16 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = #else AARCH64_R_STR (TLS_DTPMOD), /* name */ #endif - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0, /* src_mask */ ALL_ONES, /* dst_mask */ - FALSE), /* pc_reloffset */ + false), /* pc_reloffset */ HOWTO (AARCH64_R (TLS_DTPREL), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ @@ -2098,16 +2098,16 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = #else AARCH64_R_STR (TLS_DTPREL), /* name */ #endif - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0, /* src_mask */ ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLS_TPREL), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ @@ -2116,38 +2116,38 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = #else AARCH64_R_STR (TLS_TPREL), /* name */ #endif - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0, /* src_mask */ ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (TLSDESC), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + 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 */ + false, /* partial_inplace */ 0, /* src_mask */ ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ HOWTO (AARCH64_R (IRELATIVE), /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - FALSE, /* pc_relative */ + 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 */ + false, /* partial_inplace */ 0, /* src_mask */ ALL_ONES, /* dst_mask */ - FALSE), /* pcrel_offset */ + false), /* pcrel_offset */ EMPTY_HOWTO (0), }; @@ -2157,15 +2157,15 @@ static reloc_howto_type elfNN_aarch64_howto_none = 0, /* rightshift */ 3, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - FALSE, /* pc_relative */ + false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_AARCH64_NONE", /* name */ - FALSE, /* partial_inplace */ + false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - FALSE); /* pcrel_offset */ + false); /* pcrel_offset */ /* Given HOWTO, return the bfd internal relocation enumerator. */ @@ -2191,7 +2191,7 @@ elfNN_aarch64_bfd_reloc_from_howto (reloc_howto_type *howto) static bfd_reloc_code_real_type elfNN_aarch64_bfd_reloc_from_type (bfd *abfd, unsigned int r_type) { - static bfd_boolean initialized_p = FALSE; + static bool initialized_p = false; /* Indexed by R_TYPE, values are offsets in the howto_table. */ static unsigned int offsets[R_AARCH64_end]; @@ -2203,7 +2203,7 @@ elfNN_aarch64_bfd_reloc_from_type (bfd *abfd, unsigned int r_type) if (elfNN_aarch64_howto_table[i].type != 0) offsets[elfNN_aarch64_howto_table[i].type] = i; - initialized_p = TRUE; + initialized_p = true; } if (r_type == R_AARCH64_NONE || r_type == R_AARCH64_NULL) @@ -2298,7 +2298,7 @@ elfNN_aarch64_howto_from_type (bfd *abfd, unsigned int r_type) return NULL; } -static bfd_boolean +static bool elfNN_aarch64_info_to_howto (bfd *abfd, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { @@ -2311,9 +2311,9 @@ elfNN_aarch64_info_to_howto (bfd *abfd, arelent *bfd_reloc, { /* xgettext:c-format */ _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); - return FALSE; + return false; } - return TRUE; + return true; } static reloc_howto_type * @@ -2547,7 +2547,7 @@ struct elf_aarch64_obj_tdata && elf_tdata (bfd) != NULL \ && elf_object_id (bfd) == AARCH64_ELF_DATA) -static bfd_boolean +static bool elfNN_aarch64_mkobject (bfd *abfd) { return bfd_elf_allocate_object (abfd, sizeof (struct elf_aarch64_obj_tdata), @@ -2570,9 +2570,6 @@ struct elf_aarch64_link_hash_entry { struct elf_link_hash_entry root; - /* Track dynamic relocs copied for this symbol. */ - struct elf_dyn_relocs *dyn_relocs; - /* Since PLT entries have variable size, we need to record the index into .got.plt instead of recomputing it from the PLT offset. */ @@ -2646,9 +2643,6 @@ struct elf_aarch64_link_hash_table /* The bytes of the subsequent PLT entry. */ const bfd_byte *plt_entry; - /* Small local sym cache. */ - struct sym_cache sym_cache; - /* For convenience in allocate_dynrelocs. */ bfd *obfd; @@ -2685,20 +2679,9 @@ struct elf_aarch64_link_hash_table /* JUMP_SLOT relocs for variant PCS symbols may be present. */ int variant_pcs; - /* The offset into splt of the PLT entry for the TLS descriptor - resolver. Special values are 0, if not necessary (or not found - to be necessary yet), and -1 if needed but not determined - yet. */ - bfd_vma tlsdesc_plt; - /* The number of bytes in the PLT enty for the TLS descriptor. */ bfd_size_type tlsdesc_plt_entry_size; - /* The GOT offset for the lazy trampoline. Communicated to the - loader via DT_TLSDESC_GOT. The magic value (bfd_vma) -1 - indicates an offset is not allocated. */ - bfd_vma dt_tlsdesc_got; - /* Used by local STT_GNU_IFUNC symbols. */ htab_t loc_hash_table; void * loc_hash_memory; @@ -2728,7 +2711,6 @@ elfNN_aarch64_link_hash_newfunc (struct bfd_hash_entry *entry, table, string)); if (ret != NULL) { - ret->dyn_relocs = NULL; ret->got_type = GOT_UNKNOWN; ret->plt_got_offset = (bfd_vma) - 1; ret->stub_cache = NULL; @@ -2807,7 +2789,7 @@ elfNN_aarch64_local_htab_eq (const void *ptr1, const void *ptr2) static struct elf_link_hash_entry * elfNN_aarch64_get_local_sym_hash (struct elf_aarch64_link_hash_table *htab, bfd *abfd, const Elf_Internal_Rela *rel, - bfd_boolean create) + bool create) { struct elf_aarch64_link_hash_entry e, *ret; asection *sec = abfd->sections; @@ -2855,37 +2837,6 @@ elfNN_aarch64_copy_indirect_symbol (struct bfd_link_info *info, edir = (struct elf_aarch64_link_hash_entry *) dir; eind = (struct elf_aarch64_link_hash_entry *) ind; - if (eind->dyn_relocs != NULL) - { - if (edir->dyn_relocs != NULL) - { - struct elf_dyn_relocs **pp; - struct elf_dyn_relocs *p; - - /* Add reloc counts against the indirect sym to the direct sym - list. Merge any entries against the same section. */ - for (pp = &eind->dyn_relocs; (p = *pp) != NULL;) - { - struct elf_dyn_relocs *q; - - for (q = edir->dyn_relocs; q != NULL; q = q->next) - if (q->sec == p->sec) - { - q->pc_count += p->pc_count; - q->count += p->count; - *pp = p->next; - break; - } - if (q == NULL) - pp = &p->next; - } - *pp = edir->dyn_relocs; - } - - edir->dyn_relocs = eind->dyn_relocs; - eind->dyn_relocs = NULL; - } - if (ind->root.type == bfd_link_hash_indirect) { /* Copy over PLT info. */ @@ -2903,11 +2854,11 @@ elfNN_aarch64_copy_indirect_symbol (struct bfd_link_info *info, static void elfNN_aarch64_merge_symbol_attribute (struct elf_link_hash_entry *h, - const Elf_Internal_Sym *isym, - bfd_boolean definition ATTRIBUTE_UNUSED, - bfd_boolean dynamic ATTRIBUTE_UNUSED) + unsigned int st_other, + bool definition ATTRIBUTE_UNUSED, + bool dynamic ATTRIBUTE_UNUSED) { - unsigned int isym_sto = isym->st_other & ~ELF_ST_VISIBILITY (-1); + unsigned int isym_sto = st_other & ~ELF_ST_VISIBILITY (-1); unsigned int h_sto = h->other & ~ELF_ST_VISIBILITY (-1); if (isym_sto == h_sto) @@ -2947,7 +2898,7 @@ static struct bfd_link_hash_table * elfNN_aarch64_link_hash_table_create (bfd *abfd) { struct elf_aarch64_link_hash_table *ret; - bfd_size_type amt = sizeof (struct elf_aarch64_link_hash_table); + size_t amt = sizeof (struct elf_aarch64_link_hash_table); ret = bfd_zmalloc (amt); if (ret == NULL) @@ -2967,7 +2918,7 @@ elfNN_aarch64_link_hash_table_create (bfd *abfd) ret->plt_entry = elfNN_aarch64_small_plt_entry; ret->tlsdesc_plt_entry_size = PLT_TLSDESC_ENTRY_SIZE; ret->obfd = abfd; - ret->dt_tlsdesc_got = (bfd_vma) - 1; + ret->root.tlsdesc_got = (bfd_vma) - 1; if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc, sizeof (struct elf_aarch64_stub_hash_entry))) @@ -2993,7 +2944,7 @@ elfNN_aarch64_link_hash_table_create (bfd *abfd) /* Perform relocation R_TYPE. Returns TRUE upon success, FALSE otherwise. */ -static bfd_boolean +static bool aarch64_relocate (unsigned int r_type, bfd *input_bfd, asection *input_section, bfd_vma offset, bfd_vma value) { @@ -3006,7 +2957,7 @@ aarch64_relocate (unsigned int r_type, bfd *input_bfd, asection *input_section, r_type = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type); value = _bfd_aarch64_elf_resolve_relocation (input_bfd, r_type, place, - value, 0, FALSE); + value, 0, false); return _bfd_aarch64_elf_put_addend (input_bfd, input_section->contents + offset, r_type, howto, value) == bfd_reloc_ok; @@ -3099,13 +3050,13 @@ elfNN_aarch64_stub_name (const asection *input_section, executable PLT slots where the executable never takes the address of those functions, the function symbols are not added to the hash table. */ -static bfd_boolean +static bool elf_aarch64_hash_symbol (struct elf_link_hash_entry *h) { if (h->plt.offset != (bfd_vma) -1 && !h->def_regular && !h->pointer_equality_needed) - return FALSE; + return false; return _bfd_elf_hash_symbol (h); } @@ -3150,7 +3101,7 @@ elfNN_aarch64_get_stub_entry (const asection *input_section, return NULL; stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, - stub_name, FALSE, FALSE); + stub_name, false, false); if (h != NULL) h->stub_cache = stub_entry; @@ -3229,7 +3180,7 @@ _bfd_aarch64_add_stub_entry_in_group (const char *stub_name, /* Enter this entry into the linker stub hash table. */ stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name, - TRUE, FALSE); + true, false); if (stub_entry == NULL) { /* xgettext:c-format */ @@ -3261,7 +3212,7 @@ _bfd_aarch64_add_stub_entry_after (const char *stub_name, if (htab->fix_erratum_843419 & ERRAT_ADRP) stub_sec = _bfd_aarch64_get_stub_for_link_section (link_section, htab); stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name, - TRUE, FALSE); + true, false); if (stub_entry == NULL) { _bfd_error_handler (_("cannot create stub entry %s"), stub_name); @@ -3276,9 +3227,9 @@ _bfd_aarch64_add_stub_entry_after (const char *stub_name, } -static bfd_boolean +static bool aarch64_build_one_stub (struct bfd_hash_entry *gen_entry, - void *in_arg ATTRIBUTE_UNUSED) + void *in_arg) { struct elf_aarch64_stub_hash_entry *stub_entry; asection *stub_sec; @@ -3291,10 +3242,22 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry, unsigned int template_size; const uint32_t *template; unsigned int i; + struct bfd_link_info *info; /* Massage our args to the form they really have. */ stub_entry = (struct elf_aarch64_stub_hash_entry *) gen_entry; + info = (struct bfd_link_info *) in_arg; + + /* Fail if the target section could not be assigned to an output + section. The user should fix his linker script. */ + if (stub_entry->target_section->output_section == NULL + && info->non_contiguous_regions) + info->callbacks->einfo (_("%F%P: Could not assign '%pA' to an output section. " + "Retry without " + "--enable-non-contiguous-regions.\n"), + stub_entry->target_section); + stub_sec = stub_entry->stub_sec; /* Make a note of the offset within the stubs for this entry. */ @@ -3397,13 +3360,13 @@ aarch64_build_one_stub (struct bfd_hash_entry *gen_entry, abort (); } - return TRUE; + return true; } /* As above, but don't actually build the stub. Just bump offset so we know stub section sizes. */ -static bfd_boolean +static bool aarch64_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct elf_aarch64_stub_hash_entry *stub_entry; @@ -3428,7 +3391,7 @@ aarch64_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) case aarch64_stub_erratum_843419_veneer: { if (htab->fix_erratum_843419 == ERRAT_ADR) - return TRUE; + return true; size = sizeof (aarch64_erratum_843419_stub); } break; @@ -3438,7 +3401,7 @@ aarch64_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) size = (size + 7) & ~7; stub_entry->stub_sec->size += size; - return TRUE; + return true; } /* External entry points for sizing and building linker stubs. */ @@ -3456,11 +3419,11 @@ elfNN_aarch64_setup_section_lists (bfd *output_bfd, unsigned int top_id, top_index; asection *section; asection **input_list, **list; - bfd_size_type amt; + size_t amt; struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info); - if (!is_elf_hash_table (htab)) + if (!is_elf_hash_table (&htab->root.root)) return 0; /* Count the number of input BFDs and find the top input section id. */ @@ -3534,7 +3497,7 @@ elfNN_aarch64_next_input_section (struct bfd_link_info *info, asection *isec) { asection **list = htab->input_list + isec->output_section->index; - if (*list != bfd_abs_section_ptr) + if (*list != bfd_abs_section_ptr && (isec->flags & SEC_CODE) != 0) { /* Steal the link_sec pointer for our list. */ /* This happens to make the list in reverse order, @@ -3555,67 +3518,96 @@ elfNN_aarch64_next_input_section (struct bfd_link_info *info, asection *isec) static void group_sections (struct elf_aarch64_link_hash_table *htab, bfd_size_type stub_group_size, - bfd_boolean stubs_always_before_branch) + bool stubs_always_after_branch) { - asection **list = htab->input_list + htab->top_index; + asection **list = htab->input_list; do { asection *tail = *list; + asection *head; if (tail == bfd_abs_section_ptr) continue; + /* Reverse the list: we must avoid placing stubs at the + beginning of the section because the beginning of the text + section may be required for an interrupt vector in bare metal + code. */ +#define NEXT_SEC PREV_SEC + head = NULL; while (tail != NULL) + { + /* Pop from tail. */ + asection *item = tail; + tail = PREV_SEC (item); + + /* Push on head. */ + NEXT_SEC (item) = head; + head = item; + } + + while (head != NULL) { asection *curr; - asection *prev; - bfd_size_type total; + asection *next; + bfd_vma stub_group_start = head->output_offset; + bfd_vma end_of_next; - curr = tail; - total = tail->size; - while ((prev = PREV_SEC (curr)) != NULL - && ((total += curr->output_offset - prev->output_offset) - < stub_group_size)) - curr = prev; + curr = head; + while (NEXT_SEC (curr) != NULL) + { + next = NEXT_SEC (curr); + end_of_next = next->output_offset + next->size; + if (end_of_next - stub_group_start >= stub_group_size) + /* End of NEXT is too far from start, so stop. */ + break; + /* Add NEXT to the group. */ + curr = next; + } - /* OK, the size from the start of CURR to the end is less + /* OK, the size from the start to the start of CURR is less than stub_group_size and thus can be handled by one stub - section. (Or the tail section is itself larger than + section. (Or the head section is itself larger than stub_group_size, in which case we may be toast.) We should really be keeping track of the total size of stubs added here, as stubs contribute to the final output section size. */ do { - prev = PREV_SEC (tail); + next = NEXT_SEC (head); /* Set up this stub group. */ - htab->stub_group[tail->id].link_sec = curr; + htab->stub_group[head->id].link_sec = curr; } - while (tail != curr && (tail = prev) != NULL); + while (head != curr && (head = next) != NULL); /* But wait, there's more! Input sections up to stub_group_size - bytes before the stub section can be handled by it too. */ - if (!stubs_always_before_branch) + bytes after the stub section can be handled by it too. */ + if (!stubs_always_after_branch) { - total = 0; - while (prev != NULL - && ((total += tail->output_offset - prev->output_offset) - < stub_group_size)) + stub_group_start = curr->output_offset + curr->size; + + while (next != NULL) { - tail = prev; - prev = PREV_SEC (tail); - htab->stub_group[tail->id].link_sec = curr; + end_of_next = next->output_offset + next->size; + if (end_of_next - stub_group_start >= stub_group_size) + /* End of NEXT is too far from stubs, so stop. */ + break; + /* Add NEXT to the stub group. */ + head = next; + next = NEXT_SEC (head); + htab->stub_group[head->id].link_sec = curr; } } - tail = prev; + head = next; } } - while (list-- != htab->input_list); + while (list++ != htab->input_list + htab->top_index); free (htab->input_list); } +#undef PREV_SEC #undef PREV_SEC #define AARCH64_BITS(x, pos, n) (((x) >> (pos)) & ((1 << (n)) - 1)) @@ -3663,9 +3655,9 @@ group_sections (struct elf_aarch64_link_hash_table *htab, For LD/ST pair instructions PAIR is TRUE, RT and RT2 are returned. */ -static bfd_boolean +static bool aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rt2, - bfd_boolean *pair, bfd_boolean *load) + bool *pair, bool *load) { uint32_t opcode; unsigned int r; @@ -3676,32 +3668,32 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rt2, /* Bail out quickly if INSN doesn't fall into the load-store encoding space. */ if (!AARCH64_LDST (insn)) - return FALSE; + return false; - *pair = FALSE; - *load = FALSE; + *pair = false; + *load = false; if (AARCH64_LDST_EX (insn)) { *rt = AARCH64_RT (insn); *rt2 = *rt; if (AARCH64_BIT (insn, 21) == 1) { - *pair = TRUE; + *pair = true; *rt2 = AARCH64_RT2 (insn); } *load = AARCH64_LD (insn); - return TRUE; + return true; } else if (AARCH64_LDST_NAP (insn) || AARCH64_LDSTP_PI (insn) || AARCH64_LDSTP_O (insn) || AARCH64_LDSTP_PRE (insn)) { - *pair = TRUE; + *pair = true; *rt = AARCH64_RT (insn); *rt2 = AARCH64_RT2 (insn); *load = AARCH64_LD (insn); - return TRUE; + return true; } else if (AARCH64_LDST_PCREL (insn) || AARCH64_LDST_UI (insn) @@ -3714,13 +3706,13 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rt2, *rt = AARCH64_RT (insn); *rt2 = *rt; if (AARCH64_LDST_PCREL (insn)) - *load = TRUE; + *load = true; opc = AARCH64_BITS (insn, 22, 2); v = AARCH64_BIT (insn, 26); opc_v = opc | (v << 2); *load = (opc_v == 1 || opc_v == 2 || opc_v == 3 || opc_v == 5 || opc_v == 7); - return TRUE; + return true; } else if (AARCH64_LDST_SIMD_M (insn) || AARCH64_LDST_SIMD_M_PI (insn)) @@ -3750,9 +3742,9 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rt2, break; default: - return FALSE; + return false; } - return TRUE; + return true; } else if (AARCH64_LDST_SIMD_S (insn) || AARCH64_LDST_SIMD_S_PI (insn)) @@ -3784,17 +3776,17 @@ aarch64_mem_op_p (uint32_t insn, unsigned int *rt, unsigned int *rt2, break; default: - return FALSE; + return false; } - return TRUE; + return true; } - return FALSE; + return false; } /* Return TRUE if INSN is multiply-accumulate. */ -static bfd_boolean +static bool aarch64_mlxl_p (uint32_t insn) { uint32_t op31 = AARCH64_OP31 (insn); @@ -3804,9 +3796,9 @@ aarch64_mlxl_p (uint32_t insn) /* Exclude MUL instructions which are encoded as a multiple accumulate with RA = XZR. */ && AARCH64_RA (insn) != AARCH64_ZR) - return TRUE; + return true; - return FALSE; + return false; } /* Some early revisions of the Cortex-A53 have an erratum (835769) whereby @@ -3822,7 +3814,7 @@ aarch64_mlxl_p (uint32_t insn) operation (INSN_2). Return TRUE if an erratum sequence is found, FALSE if INSN_1 and INSN_2 are safe. */ -static bfd_boolean +static bool aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2) { uint32_t rt; @@ -3830,8 +3822,8 @@ aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2) uint32_t rn; uint32_t rm; uint32_t ra; - bfd_boolean pair; - bfd_boolean load; + bool pair; + bool load; if (aarch64_mlxl_p (insn_2) && aarch64_mem_op_p (insn_1, &rt, &rt2, &pair, &load)) @@ -3839,7 +3831,7 @@ aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2) /* Any SIMD memory op is independent of the subsequent MLA by definition of the erratum. */ if (AARCH64_BIT (insn_1, 26)) - return TRUE; + return true; /* If not SIMD, check for integer memory ops and MLA relationship. */ rn = AARCH64_RN (insn_2); @@ -3851,14 +3843,14 @@ aarch64_erratum_sequence (uint32_t insn_1, uint32_t insn_2) if (load && (rt == rn || rt == rm || rt == ra || (pair && (rt2 == rn || rt2 == rm || rt2 == ra)))) - return FALSE; + return false; /* We conservatively put out stubs for all other cases (including writebacks). */ - return TRUE; + return true; } - return FALSE; + return false; } /* Used to order a list of mapping symbols by address. */ @@ -3899,7 +3891,7 @@ _bfd_aarch64_erratum_835769_stub_name (unsigned num_fixes) Return TRUE else FALSE on abnormal termination. */ -static bfd_boolean +static bool _bfd_aarch64_erratum_835769_scan (bfd *input_bfd, struct bfd_link_info *info, unsigned int *num_fixes_p) @@ -3909,7 +3901,7 @@ _bfd_aarch64_erratum_835769_scan (bfd *input_bfd, unsigned int num_fixes = *num_fixes_p; if (htab == NULL) - return TRUE; + return true; for (section = input_bfd->sections; section != NULL; @@ -3929,12 +3921,13 @@ _bfd_aarch64_erratum_835769_scan (bfd *input_bfd, if (elf_section_data (section)->this_hdr.contents != NULL) contents = elf_section_data (section)->this_hdr.contents; else if (! bfd_malloc_and_get_section (input_bfd, section, &contents)) - return FALSE; + return false; sec_data = elf_aarch64_section_data (section); - qsort (sec_data->map, sec_data->mapcount, - sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); + if (sec_data->mapcount) + qsort (sec_data->map, sec_data->mapcount, + sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); for (span = 0; span < sec_data->mapcount; span++) { @@ -3958,13 +3951,13 @@ _bfd_aarch64_erratum_835769_scan (bfd *input_bfd, struct elf_aarch64_stub_hash_entry *stub_entry; char *stub_name = _bfd_aarch64_erratum_835769_stub_name (num_fixes); if (! stub_name) - return FALSE; + return false; stub_entry = _bfd_aarch64_add_stub_entry_in_group (stub_name, section, htab); if (! stub_entry) - return FALSE; + return false; stub_entry->stub_type = aarch64_stub_erratum_835769_veneer; stub_entry->target_section = section; @@ -3981,13 +3974,13 @@ _bfd_aarch64_erratum_835769_scan (bfd *input_bfd, *num_fixes_p = num_fixes; - return TRUE; + return true; } /* Test if instruction INSN is ADRP. */ -static bfd_boolean +static bool _bfd_aarch64_adrp_p (uint32_t insn) { return ((insn & AARCH64_ADRP_OP_MASK) == AARCH64_ADRP_OP); @@ -3996,14 +3989,14 @@ _bfd_aarch64_adrp_p (uint32_t insn) /* Helper predicate to look for cortex-a53 erratum 843419 sequence 1. */ -static bfd_boolean +static bool _bfd_aarch64_erratum_843419_sequence_p (uint32_t insn_1, uint32_t insn_2, uint32_t insn_3) { uint32_t rt; uint32_t rt2; - bfd_boolean pair; - bfd_boolean load; + bool pair; + bool load; return (aarch64_mem_op_p (insn_2, &rt, &rt2, &pair, &load) && (!pair @@ -4021,7 +4014,7 @@ _bfd_aarch64_erratum_843419_sequence_p (uint32_t insn_1, uint32_t insn_2, instruction in the sequence. */ -static bfd_boolean +static bool _bfd_aarch64_erratum_843419_p (bfd_byte *contents, bfd_vma vma, bfd_vma i, bfd_vma span_end, bfd_vma *p_veneer_i) @@ -4029,35 +4022,35 @@ _bfd_aarch64_erratum_843419_p (bfd_byte *contents, bfd_vma vma, uint32_t insn_1 = bfd_getl32 (contents + i); if (!_bfd_aarch64_adrp_p (insn_1)) - return FALSE; + return false; if (span_end < i + 12) - return FALSE; + return false; uint32_t insn_2 = bfd_getl32 (contents + i + 4); uint32_t insn_3 = bfd_getl32 (contents + i + 8); if ((vma & 0xfff) != 0xff8 && (vma & 0xfff) != 0xffc) - return FALSE; + return false; if (_bfd_aarch64_erratum_843419_sequence_p (insn_1, insn_2, insn_3)) { *p_veneer_i = i + 8; - return TRUE; + return true; } if (span_end < i + 16) - return FALSE; + return false; uint32_t insn_4 = bfd_getl32 (contents + i + 12); if (_bfd_aarch64_erratum_843419_sequence_p (insn_1, insn_2, insn_4)) { *p_veneer_i = i + 12; - return TRUE; + return true; } - return FALSE; + return false; } @@ -4128,7 +4121,7 @@ _bfd_aarch64_erratum_843419_stub_name (asection *input_section, Returns TRUE on success. */ -static bfd_boolean +static bool _bfd_aarch64_erratum_843419_fixup (uint32_t insn, bfd_vma adrp_offset, bfd_vma ldst_offset, @@ -4141,13 +4134,13 @@ _bfd_aarch64_erratum_843419_fixup (uint32_t insn, stub_name = _bfd_aarch64_erratum_843419_stub_name (section, ldst_offset); if (stub_name == NULL) - return FALSE; + return false; stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, stub_name, - FALSE, FALSE); + false, false); if (stub_entry) { free (stub_name); - return TRUE; + return true; } /* We always place an 843419 workaround veneer in the stub section @@ -4165,7 +4158,7 @@ _bfd_aarch64_erratum_843419_fixup (uint32_t insn, if (stub_entry == NULL) { free (stub_name); - return FALSE; + return false; } stub_entry->adrp_offset = adrp_offset; @@ -4175,7 +4168,7 @@ _bfd_aarch64_erratum_843419_fixup (uint32_t insn, stub_entry->veneered_insn = insn; stub_entry->output_name = stub_name; - return TRUE; + return true; } @@ -4188,21 +4181,21 @@ _bfd_aarch64_erratum_843419_fixup (uint32_t insn, Return TRUE on successful scan, FALSE on failure to scan. */ -static bfd_boolean +static bool _bfd_aarch64_erratum_843419_scan (bfd *input_bfd, asection *section, struct bfd_link_info *info) { struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info); if (htab == NULL) - return TRUE; + return true; if (elf_section_type (section) != SHT_PROGBITS || (elf_section_flags (section) & SHF_EXECINSTR) == 0 || (section->flags & SEC_EXCLUDE) != 0 || (section->sec_info_type == SEC_INFO_TYPE_JUST_SYMS) || (section->output_section == bfd_abs_section_ptr)) - return TRUE; + return true; do { @@ -4213,12 +4206,13 @@ _bfd_aarch64_erratum_843419_scan (bfd *input_bfd, asection *section, if (elf_section_data (section)->this_hdr.contents != NULL) contents = elf_section_data (section)->this_hdr.contents; else if (! bfd_malloc_and_get_section (input_bfd, section, &contents)) - return FALSE; + return false; sec_data = elf_aarch64_section_data (section); - qsort (sec_data->map, sec_data->mapcount, - sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); + if (sec_data->mapcount) + qsort (sec_data->map, sec_data->mapcount, + sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); for (span = 0; span < sec_data->mapcount; span++) { @@ -4246,7 +4240,7 @@ _bfd_aarch64_erratum_843419_scan (bfd *input_bfd, asection *section, if (!_bfd_aarch64_erratum_843419_fixup (insn, i, veneer_i, section, info)) - return FALSE; + return false; } } } @@ -4256,7 +4250,7 @@ _bfd_aarch64_erratum_843419_scan (bfd *input_bfd, asection *section, } while (0); - return TRUE; + return true; } @@ -4266,7 +4260,7 @@ _bfd_aarch64_erratum_843419_scan (bfd *input_bfd, asection *section, PC-relative calls to a target that is unreachable with a "bl" instruction. */ -bfd_boolean +bool elfNN_aarch64_size_stubs (bfd *output_bfd, bfd *stub_bfd, struct bfd_link_info *info, @@ -4276,8 +4270,8 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, void (*layout_sections_again) (void)) { bfd_size_type stub_group_size; - bfd_boolean stubs_always_before_branch; - bfd_boolean stub_changed = FALSE; + bool stubs_always_before_branch; + bool stub_changed = false; struct elf_aarch64_link_hash_table *htab = elf_aarch64_hash_table (info); unsigned int num_erratum_835769_fixes = 0; @@ -4313,9 +4307,15 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, for (input_bfd = info->input_bfds; input_bfd != NULL; input_bfd = input_bfd->link.next) - if (!_bfd_aarch64_erratum_835769_scan (input_bfd, info, - &num_erratum_835769_fixes)) - return FALSE; + { + if (!is_aarch64_elf (input_bfd) + || (input_bfd->flags & BFD_LINKER_CREATED) != 0) + continue; + + if (!_bfd_aarch64_erratum_835769_scan (input_bfd, info, + &num_erratum_835769_fixes)) + return false; + } _bfd_aarch64_resize_stubs (htab); (*htab->layout_sections_again) (); @@ -4331,11 +4331,15 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, { asection *section; + if (!is_aarch64_elf (input_bfd) + || (input_bfd->flags & BFD_LINKER_CREATED) != 0) + continue; + for (section = input_bfd->sections; section != NULL; section = section->next) if (!_bfd_aarch64_erratum_843419_scan (input_bfd, section, info)) - return FALSE; + return false; } _bfd_aarch64_resize_stubs (htab); @@ -4353,6 +4357,10 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, asection *section; Elf_Internal_Sym *local_syms = NULL; + if (!is_aarch64_elf (input_bfd) + || (input_bfd->flags & BFD_LINKER_CREATED) != 0) + continue; + /* We'll need the symbol table in a second. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; if (symtab_hdr->sh_info == 0) @@ -4556,7 +4564,7 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, stub_entry = aarch64_stub_hash_lookup (&htab->stub_hash_table, - stub_name, FALSE, FALSE); + stub_name, false, false); if (stub_entry != NULL) { /* The proper stub has already been created. */ @@ -4594,7 +4602,7 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, snprintf (stub_entry->output_name, len, STUB_ENTRY_NAME, sym_name); - stub_changed = TRUE; + stub_changed = true; } /* We're done with the internal relocs, free them. */ @@ -4610,13 +4618,13 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, /* Ask the linker to do its stuff. */ (*htab->layout_sections_again) (); - stub_changed = FALSE; + stub_changed = false; } - return TRUE; + return true; -error_ret_free_local: - return FALSE; + error_ret_free_local: + return false; } /* Build all the stubs associated with the current output file. The @@ -4625,7 +4633,7 @@ error_ret_free_local: functions here. This function is called via aarch64_elf_finish in the linker. */ -bfd_boolean +bool elfNN_aarch64_build_stubs (struct bfd_link_info *info) { asection *stub_sec; @@ -4647,7 +4655,7 @@ elfNN_aarch64_build_stubs (struct bfd_link_info *info) size = stub_sec->size; stub_sec->contents = bfd_zalloc (htab->stub_bfd, size); if (stub_sec->contents == NULL && size != 0) - return FALSE; + return false; stub_sec->size = 0; /* Add a branch around the stub section, and a nop, to keep it 8 byte @@ -4661,7 +4669,7 @@ elfNN_aarch64_build_stubs (struct bfd_link_info *info) table = &htab->stub_hash_table; bfd_hash_traverse (table, aarch64_build_one_stub, info); - return TRUE; + return true; } @@ -4831,11 +4839,11 @@ aarch64_calculate_got_entry_vma (struct elf_link_hash_entry *h, struct elf_aarch64_link_hash_table *globals, struct bfd_link_info *info, bfd_vma value, bfd *output_bfd, - bfd_boolean *unresolved_reloc_p) + bool *unresolved_reloc_p) { bfd_vma off = (bfd_vma) - 1; asection *basegot = globals->root.sgot; - bfd_boolean dyn = globals->root.dynamic_sections_created; + bool dyn = globals->root.dynamic_sections_created; if (h != NULL) { @@ -4866,7 +4874,7 @@ aarch64_calculate_got_entry_vma (struct elf_link_hash_entry *h, } } else - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; off = off + basegot->output_section->vma + basegot->output_offset; } @@ -4881,7 +4889,7 @@ static bfd_reloc_code_real_type aarch64_tls_transition_without_check (bfd_reloc_code_real_type r_type, struct elf_link_hash_entry *h) { - bfd_boolean is_local = h == NULL; + bool is_local = h == NULL; switch (r_type) { @@ -5019,7 +5027,7 @@ aarch64_reloc_got_type (bfd_reloc_code_real_type r_type) return GOT_UNKNOWN; } -static bfd_boolean +static bool aarch64_can_relax_tls (bfd *input_bfd, struct bfd_link_info *info, bfd_reloc_code_real_type r_type, @@ -5030,21 +5038,21 @@ aarch64_can_relax_tls (bfd *input_bfd, unsigned int reloc_got_type; if (! IS_AARCH64_TLS_RELAX_RELOC (r_type)) - return FALSE; + return false; symbol_got_type = elfNN_aarch64_symbol_got_type (h, input_bfd, r_symndx); reloc_got_type = aarch64_reloc_got_type (r_type); if (symbol_got_type == GOT_TLS_IE && GOT_TLS_GD_ANY_P (reloc_got_type)) - return TRUE; + return true; if (!bfd_link_executable (info)) - return FALSE; + return false; if (h && h->root.type == bfd_link_hash_undefweak) - return FALSE; + return false; - return TRUE; + return true; } /* Given the relocation code R_TYPE, return the relaxed bfd reloc @@ -5202,7 +5210,7 @@ struct erratum_835769_branch_to_stub_data /* Helper to insert branches to erratum 835769 stubs in the right places for a particular section. */ -static bfd_boolean +static bool make_branch_to_erratum_835769_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { @@ -5220,7 +5228,7 @@ make_branch_to_erratum_835769_stub (struct bfd_hash_entry *gen_entry, if (stub_entry->target_section != data->output_section || stub_entry->stub_type != aarch64_stub_erratum_835769_veneer) - return TRUE; + return true; contents = data->contents; veneered_insn_loc = stub_entry->target_section->output_section->vma @@ -5244,11 +5252,11 @@ make_branch_to_erratum_835769_stub (struct bfd_hash_entry *gen_entry, branch_insn |= branch_offset; bfd_putl32 (branch_insn, &contents[target]); - return TRUE; + return true; } -static bfd_boolean +static bool _bfd_aarch64_erratum_843419_branch_to_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { @@ -5272,7 +5280,7 @@ _bfd_aarch64_erratum_843419_branch_to_stub (struct bfd_hash_entry *gen_entry, if (stub_entry->target_section != section || stub_entry->stub_type != aarch64_stub_erratum_843419_veneer) - return TRUE; + return true; BFD_ASSERT (((htab->fix_erratum_843419 & ERRAT_ADRP) && stub_entry->stub_sec) || (htab->fix_erratum_843419 & ERRAT_ADR)); @@ -5350,11 +5358,11 @@ _bfd_aarch64_erratum_843419_branch_to_stub (struct bfd_hash_entry *gen_entry, To prevent this, issue a hard abort. */ BFD_FAIL (); } - return TRUE; + return true; } -static bfd_boolean +static bool elfNN_aarch64_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *link_info, asection *sec, @@ -5365,7 +5373,7 @@ elfNN_aarch64_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, elf_aarch64_hash_table (link_info); if (globals == NULL) - return FALSE; + return false; /* Fix code to point to erratum 835769 stubs. */ if (globals->fix_erratum_835769) @@ -5390,12 +5398,12 @@ elfNN_aarch64_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, _bfd_aarch64_erratum_843419_branch_to_stub, &data); } - return FALSE; + return false; } /* Return TRUE if RELOC is a relocation against the base of GOT table. */ -static bfd_boolean +static bool aarch64_relocation_aginst_gp_p (bfd_reloc_code_real_type reloc) { return (reloc == BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 @@ -5419,8 +5427,8 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, struct bfd_link_info *info, asection *sym_sec, struct elf_link_hash_entry *h, - bfd_boolean *unresolved_reloc_p, - bfd_boolean save_addend, + bool *unresolved_reloc_p, + bool save_addend, bfd_vma *saved_addend, Elf_Internal_Sym *sym) { @@ -5433,12 +5441,12 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, bfd_vma place, off, got_entry_addr = 0; bfd_signed_vma signed_addend; struct elf_aarch64_link_hash_table *globals; - bfd_boolean weak_undef_p; - bfd_boolean relative_reloc; + bool weak_undef_p; + bool relative_reloc; asection *base_got; bfd_vma orig_value = value; - bfd_boolean resolved_to_zero; - bfd_boolean abs_symbol_p; + bool resolved_to_zero; + bool abs_symbol_p; globals = elf_aarch64_hash_table (info); @@ -5507,7 +5515,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, switch (bfd_r_type) { default: -bad_ifunc_reloc: + bad_ifunc_reloc: if (h->root.root.string) name = h->root.root.string; else @@ -5685,7 +5693,7 @@ bad_ifunc_reloc: case BFD_RELOC_AARCH64_TLSDESC_ADD: case BFD_RELOC_AARCH64_TLSDESC_CALL: case BFD_RELOC_AARCH64_TLSDESC_LDR: - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; return bfd_reloc_ok; case BFD_RELOC_AARCH64_NN: @@ -5716,24 +5724,24 @@ bad_ifunc_reloc: { Elf_Internal_Rela outrel; bfd_byte *loc; - bfd_boolean skip, relocate; + bool skip, relocate; asection *sreloc; - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; - skip = FALSE; - relocate = FALSE; + skip = false; + relocate = false; outrel.r_addend = signed_addend; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) - 1) - skip = TRUE; + skip = true; else if (outrel.r_offset == (bfd_vma) - 2) { - skip = TRUE; - relocate = TRUE; + skip = true; + relocate = true; } else if (abs_symbol_p) { @@ -5761,7 +5769,7 @@ bad_ifunc_reloc: relocate the text and data segments independently, so the symbol does not matter. */ symbol = 0; - relocate = globals->no_apply_dynamic_relocs ? FALSE : TRUE; + relocate = !globals->no_apply_dynamic_relocs; outrel.r_info = ELFNN_R_INFO (symbol, AARCH64_R (RELATIVE)); outrel.r_addend += value; } @@ -5799,7 +5807,7 @@ bad_ifunc_reloc: case BFD_RELOC_AARCH64_JUMP26: { asection *splt = globals->root.splt; - bfd_boolean via_plt_p = + bool via_plt_p = splt != NULL && h != NULL && h->plt.offset != (bfd_vma) - 1; /* A call to an undefined weak symbol is converted to a jump to @@ -5847,7 +5855,7 @@ bad_ifunc_reloc: value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, place, value, signed_addend, weak_undef_p); - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; break; case BFD_RELOC_AARCH64_16_PCREL: @@ -5881,6 +5889,23 @@ bad_ifunc_reloc: bfd_set_error (bfd_error_bad_value); return bfd_reloc_notsupported; } + value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, + place, value, + signed_addend, + weak_undef_p); + break; + + case BFD_RELOC_AARCH64_BRANCH19: + case BFD_RELOC_AARCH64_TSTBR14: + if (h && h->root.type == bfd_link_hash_undefined) + { + _bfd_error_handler + /* xgettext:c-format */ + (_("%pB: conditional branch to undefined symbol `%s' " + "not allowed"), input_bfd, h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return bfd_reloc_notsupported; + } /* Fall through. */ case BFD_RELOC_AARCH64_16: @@ -5888,7 +5913,6 @@ bad_ifunc_reloc: case BFD_RELOC_AARCH64_32: #endif case BFD_RELOC_AARCH64_ADD_LO12: - case BFD_RELOC_AARCH64_BRANCH19: case BFD_RELOC_AARCH64_LDST128_LO12: case BFD_RELOC_AARCH64_LDST16_LO12: case BFD_RELOC_AARCH64_LDST32_LO12: @@ -5904,7 +5928,6 @@ bad_ifunc_reloc: case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_S: case BFD_RELOC_AARCH64_MOVW_G3: - case BFD_RELOC_AARCH64_TSTBR14: value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, place, value, signed_addend, weak_undef_p); @@ -5922,7 +5945,7 @@ bad_ifunc_reloc: if (globals->root.sgot == NULL) BFD_ASSERT (h != NULL); - relative_reloc = FALSE; + relative_reloc = false; if (h != NULL) { bfd_vma addend = 0; @@ -5938,7 +5961,7 @@ bad_ifunc_reloc: && h->root.type != bfd_link_hash_undefweak && bfd_link_pic (info) && !symbol_got_offset_mark_p (input_bfd, h, r_symndx)) - relative_reloc = TRUE; + relative_reloc = true; value = aarch64_calculate_got_entry_vma (h, globals, info, value, output_bfd, @@ -5987,7 +6010,7 @@ bad_ifunc_reloc: base address. So, we need to generate a R_AARCH64_RELATIVE reloc for dynamic linker. */ if (bfd_link_pic (info)) - relative_reloc = TRUE; + relative_reloc = true; symbol_got_offset_mark (input_bfd, h, r_symndx); } @@ -6040,7 +6063,7 @@ bad_ifunc_reloc: value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, place, value, 0, weak_undef_p); - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; break; case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC: @@ -6054,7 +6077,7 @@ bad_ifunc_reloc: value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, place, value, 0, weak_undef_p); - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; break; case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12: @@ -6128,7 +6151,7 @@ bad_ifunc_reloc: value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, place, value, def_value, weak_undef_p); - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; break; } @@ -6148,7 +6171,7 @@ bad_ifunc_reloc: value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, place, value, 0, weak_undef_p); - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; break; case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: @@ -6167,7 +6190,7 @@ bad_ifunc_reloc: value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type, place, value, 0, weak_undef_p); - *unresolved_reloc_p = FALSE; + *unresolved_reloc_p = false; break; default: @@ -6227,7 +6250,7 @@ struct erratum_843419_branch_to_stub_clear_data section inside IN_ARG matches. The clearing is done by setting the stub_type to none. */ -static bfd_boolean +static bool _bfd_aarch64_erratum_843419_clear_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { @@ -6239,7 +6262,7 @@ _bfd_aarch64_erratum_843419_clear_stub (struct bfd_hash_entry *gen_entry, if (stub_entry->target_section != data->output_section || stub_entry->stub_type != aarch64_stub_erratum_843419_veneer || stub_entry->adrp_offset != data->adrp_offset) - return TRUE; + return true; /* Change the stub type instead of removing the entry, removing from the hash table would be slower and we have already reserved the memory for the entry @@ -6249,7 +6272,7 @@ _bfd_aarch64_erratum_843419_clear_stub (struct bfd_hash_entry *gen_entry, /* We're done and there could have been only one matching stub at that particular offset, so abort further traversal. */ - return FALSE; + return false; } /* TLS Relaxations may relax an adrp sequence that matches the erratum 843419 @@ -6286,7 +6309,7 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals, bfd_byte *contents, Elf_Internal_Rela *rel, struct elf_link_hash_entry *h) { - bfd_boolean is_local = h == NULL; + bool is_local = h == NULL; unsigned int r_type = ELFNN_R_TYPE (rel->r_info); unsigned long insn; @@ -6674,7 +6697,7 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals, /* Relocate an AArch64 ELF section. */ -static bfd_boolean +static int elfNN_aarch64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd, @@ -6690,7 +6713,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, Elf_Internal_Rela *relend; const char *name; struct elf_aarch64_link_hash_table *globals; - bfd_boolean save_addend = FALSE; + bool save_addend = false; bfd_vma addend = 0; globals = elf_aarch64_hash_table (info); @@ -6714,7 +6737,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, bfd_reloc_status_type r; arelent bfd_reloc; char sym_type; - bfd_boolean unresolved_reloc = FALSE; + bool unresolved_reloc = false; char *error_message = NULL; r_symndx = ELFNN_R_SYM (rel->r_info); @@ -6747,7 +6770,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, (*info->callbacks->undefined_symbol) (info, bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name), - input_bfd, input_section, rel->r_offset, TRUE); + input_bfd, input_section, rel->r_offset, true); relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); @@ -6756,7 +6779,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) { h = elfNN_aarch64_get_local_sym_hash (globals, input_bfd, - rel, FALSE); + rel, false); if (h == NULL) abort (); @@ -6767,7 +6790,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, } else { - bfd_boolean warned, ignored; + bool warned, ignored; RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, @@ -6839,9 +6862,9 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, && rel->r_offset == rel[1].r_offset && ELFNN_R_TYPE (rel[1].r_info) != R_AARCH64_NONE && ELFNN_R_TYPE (rel[1].r_info) != R_AARCH64_NULL) - save_addend = TRUE; + save_addend = true; else - save_addend = FALSE; + save_addend = false; if (r == bfd_reloc_continue) r = elfNN_aarch64_final_link_relocate (howto, input_bfd, output_bfd, @@ -6862,7 +6885,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21: if (! symbol_got_offset_mark_p (input_bfd, h, r_symndx)) { - bfd_boolean need_relocs = FALSE; + bool need_relocs = false; bfd_byte *loc; int indx; bfd_vma off; @@ -6956,7 +6979,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: if (! symbol_got_offset_mark_p (input_bfd, h, r_symndx)) { - bfd_boolean need_relocs = FALSE; + bool need_relocs = false; bfd_byte *loc; int indx; bfd_vma off; @@ -7012,7 +7035,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, case BFD_RELOC_AARCH64_TLSDESC_OFF_G1: if (! symbol_tlsdesc_got_offset_mark_p (input_bfd, h, r_symndx)) { - bfd_boolean need_relocs = FALSE; + bool need_relocs = false; int indx = h && h->dynindx != -1 ? h->dynindx : 0; bfd_vma off = symbol_tlsdesc_got_offset (input_bfd, h, r_symndx); @@ -7082,7 +7105,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, (uint64_t) rel->r_offset, howto->name, h->root.root.string); - return FALSE; + return false; } if (r != bfd_reloc_ok && r != bfd_reloc_continue) @@ -7104,7 +7127,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, _("too many GOT entries for -fpic, " "please recompile with -fPIC"), name, input_bfd, input_section, rel->r_offset); - return FALSE; + return false; } /* Overflow can occur when a variable is referenced with a type that has a larger alignment than the type with which it was @@ -7119,7 +7142,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, Try to catch this situation here and provide a more helpful error message to the user. */ - if (addend & ((1 << howto->rightshift) - 1) + if (addend & (((bfd_vma) 1 << howto->rightshift) - 1) /* FIXME: Are we testing all of the appropriate reloc types here ? */ && (real_r_type == BFD_RELOC_AARCH64_LD_LO19_PCREL @@ -7138,7 +7161,7 @@ alignment than was declared where it was defined"), case bfd_reloc_undefined: (*info->callbacks->undefined_symbol) - (info, name, input_bfd, input_section, rel->r_offset, TRUE); + (info, name, input_bfd, input_section, rel->r_offset, true); break; case bfd_reloc_outofrange: @@ -7169,12 +7192,12 @@ alignment than was declared where it was defined"), addend = 0; } - return TRUE; + return true; } /* Set the right machine number. */ -static bfd_boolean +static bool elfNN_aarch64_object_p (bfd *abfd) { #if ARCH_SIZE == 32 @@ -7182,12 +7205,12 @@ elfNN_aarch64_object_p (bfd *abfd) #else bfd_default_set_arch_mach (abfd, bfd_arch_aarch64, bfd_mach_aarch64); #endif - return TRUE; + return true; } /* Function to keep AArch64 specific flags in the ELF header. */ -static bfd_boolean +static bool elfNN_aarch64_set_private_flags (bfd *abfd, flagword flags) { if (elf_flags_init (abfd) && elf_elfheader (abfd)->e_flags != flags) @@ -7196,30 +7219,30 @@ elfNN_aarch64_set_private_flags (bfd *abfd, flagword flags) else { elf_elfheader (abfd)->e_flags = flags; - elf_flags_init (abfd) = TRUE; + elf_flags_init (abfd) = true; } - return TRUE; + return true; } /* Merge backend specific data from an object file to the output object file when linking. */ -static bfd_boolean +static bool elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { bfd *obfd = info->output_bfd; flagword out_flags; flagword in_flags; - bfd_boolean flags_compatible = TRUE; + bool flags_compatible = true; asection *sec; /* Check if we have the same endianess. */ if (!_bfd_generic_verify_endian_match (ibfd, info)) - return FALSE; + return false; if (!is_aarch64_elf (ibfd) || !is_aarch64_elf (obfd)) - return TRUE; + return true; /* The input BFD must have had its flags initialised. */ /* The following seems bogus to me -- The flags are initialized in @@ -7240,9 +7263,9 @@ elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) to the default values. */ if (bfd_get_arch_info (ibfd)->the_default && elf_elfheader (ibfd)->e_flags == 0) - return TRUE; + return true; - elf_flags_init (obfd) = TRUE; + elf_flags_init (obfd) = true; elf_elfheader (obfd)->e_flags = in_flags; if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) @@ -7250,12 +7273,12 @@ elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); - return TRUE; + return true; } /* Identical flags must be compatible. */ if (in_flags == out_flags) - return TRUE; + return true; /* Check to see if the input BFD actually contains any sections. If not, its flags may not have been initialised either, but it @@ -7269,22 +7292,22 @@ elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) in data sections ? */ if (!(ibfd->flags & DYNAMIC)) { - bfd_boolean null_input_bfd = TRUE; - bfd_boolean only_data_sections = TRUE; + bool null_input_bfd = true; + bool only_data_sections = true; for (sec = ibfd->sections; sec != NULL; sec = sec->next) { if ((bfd_section_flags (sec) & (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS)) == (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS)) - only_data_sections = FALSE; + only_data_sections = false; - null_input_bfd = FALSE; + null_input_bfd = false; break; } if (null_input_bfd || only_data_sections) - return TRUE; + return true; } return flags_compatible; @@ -7292,7 +7315,7 @@ elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) /* Display the flags field. */ -static bfd_boolean +static bool elfNN_aarch64_print_private_bfd_data (bfd *abfd, void *ptr) { FILE *file = (FILE *) ptr; @@ -7308,56 +7331,39 @@ elfNN_aarch64_print_private_bfd_data (bfd *abfd, void *ptr) containing valid data. */ /* xgettext:c-format */ - fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + fprintf (file, _("private flags = 0x%lx:"), elf_elfheader (abfd)->e_flags); if (flags) - fprintf (file, _("")); + fprintf (file, _(" ")); fputc ('\n', file); - return TRUE; -} - -/* Find dynamic relocs for H that apply to read-only sections. */ - -static asection * -readonly_dynrelocs (struct elf_link_hash_entry *h) -{ - struct elf_dyn_relocs *p; - - for (p = elf_aarch64_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) - { - asection *s = p->sec->output_section; - - if (s != NULL && (s->flags & SEC_READONLY) != 0) - return p->sec; - } - return NULL; + return true; } /* Return true if we need copy relocation against EH. */ -static bfd_boolean +static bool need_copy_relocation_p (struct elf_aarch64_link_hash_entry *eh) { struct elf_dyn_relocs *p; asection *s; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + for (p = eh->root.dyn_relocs; p != NULL; p = p->next) { /* If there is any pc-relative reference, we need to keep copy relocation to avoid propagating the relocation into runtime that current glibc does not support. */ if (p->pc_count) - return TRUE; + return true; s = p->sec->output_section; /* Need copy relocation if it's against read-only section. */ if (s != NULL && (s->flags & SEC_READONLY) != 0) - return TRUE; + return true; } - return FALSE; + return false; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -7366,7 +7372,7 @@ need_copy_relocation_p (struct elf_aarch64_link_hash_entry *eh) change the definition to something the rest of the link can understand. */ -static bfd_boolean +static bool elfNN_aarch64_adjust_dynamic_symbol (struct bfd_link_info *info, struct elf_link_hash_entry *h) { @@ -7393,7 +7399,7 @@ elfNN_aarch64_adjust_dynamic_symbol (struct bfd_link_info *info, h->needs_plt = 0; } - return TRUE; + return true; } else /* Otherwise, reset to -1. */ @@ -7411,7 +7417,7 @@ elfNN_aarch64_adjust_dynamic_symbol (struct bfd_link_info *info, h->root.u.def.value = def->root.u.def.value; if (ELIMINATE_COPY_RELOCS || info->nocopyreloc) h->non_got_ref = def->non_got_ref; - return TRUE; + return true; } /* If we are creating a shared library, we must presume that the @@ -7419,18 +7425,18 @@ elfNN_aarch64_adjust_dynamic_symbol (struct bfd_link_info *info, For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (bfd_link_pic (info)) - return TRUE; + return true; /* If there are no references to this symbol that do not use the GOT, we don't need to generate a copy reloc. */ if (!h->non_got_ref) - return TRUE; + return true; /* If -z nocopyreloc was given, we won't generate them either. */ if (info->nocopyreloc) { h->non_got_ref = 0; - return TRUE; + return true; } if (ELIMINATE_COPY_RELOCS) @@ -7442,7 +7448,7 @@ elfNN_aarch64_adjust_dynamic_symbol (struct bfd_link_info *info, if (!need_copy_relocation_p (eh)) { h->non_got_ref = 0; - return TRUE; + return true; } } @@ -7481,7 +7487,7 @@ elfNN_aarch64_adjust_dynamic_symbol (struct bfd_link_info *info, } -static bfd_boolean +static bool elfNN_aarch64_allocate_local_symbols (bfd *abfd, unsigned number) { struct elf_aarch64_local_symbol *locals; @@ -7491,15 +7497,15 @@ elfNN_aarch64_allocate_local_symbols (bfd *abfd, unsigned number) locals = (struct elf_aarch64_local_symbol *) bfd_zalloc (abfd, number * sizeof (struct elf_aarch64_local_symbol)); if (locals == NULL) - return FALSE; + return false; elf_aarch64_locals (abfd) = locals; } - return TRUE; + return true; } /* Create the .got section to hold the global offset table. */ -static bfd_boolean +static bool aarch64_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) { const struct elf_backend_data *bed = get_elf_backend_data (abfd); @@ -7510,7 +7516,7 @@ aarch64_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) /* This function may be called more than once. */ if (htab->sgot != NULL) - return TRUE; + return true; flags = bed->dynamic_sec_flags; @@ -7521,13 +7527,13 @@ aarch64_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) | SEC_READONLY)); if (s == NULL || !bfd_set_section_alignment (s, bed->s->log_file_align)) - return FALSE; + return false; htab->srelgot = s; s = bfd_make_section_anyway_with_flags (abfd, ".got", flags); if (s == NULL || !bfd_set_section_alignment (s, bed->s->log_file_align)) - return FALSE; + return false; htab->sgot = s; htab->sgot->size += GOT_ENTRY_SIZE; @@ -7541,7 +7547,7 @@ aarch64_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) "_GLOBAL_OFFSET_TABLE_"); elf_hash_table (info)->hgot = h; if (h == NULL) - return FALSE; + return false; } if (bed->want_got_plt) @@ -7549,19 +7555,19 @@ aarch64_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags); if (s == NULL || !bfd_set_section_alignment (s, bed->s->log_file_align)) - return FALSE; + return false; htab->sgotplt = s; } /* The first bit of the global offset table is the header. */ s->size += bed->got_header_size; - return TRUE; + return true; } /* Look through the relocs for a section during the first phase. */ -static bfd_boolean +static bool elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, const Elf_Internal_Rela *relocs) { @@ -7574,7 +7580,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, struct elf_aarch64_link_hash_table *htab; if (bfd_link_relocatable (info)) - return TRUE; + return true; BFD_ASSERT (is_aarch64_elf (abfd)); @@ -7600,24 +7606,24 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, { /* xgettext:c-format */ _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); - return FALSE; + return false; } if (r_symndx < symtab_hdr->sh_info) { /* A local symbol. */ - isym = bfd_sym_from_r_symndx (&htab->sym_cache, + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, abfd, r_symndx); if (isym == NULL) - return FALSE; + return false; /* Check relocation against local STT_GNU_IFUNC symbol. */ if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) { h = elfNN_aarch64_get_local_sym_hash (htab, abfd, rel, - TRUE); + true); if (h == NULL) - return FALSE; + return false; /* Fake a STT_GNU_IFUNC symbol. */ h->type = STT_GNU_IFUNC; @@ -7653,7 +7659,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, htab->root.dynobj = abfd; if (! aarch64_elf_create_got_section (htab->root.dynobj, info)) - return FALSE; + return false; BFD_ASSERT (h == htab->root.hgot); } @@ -7684,7 +7690,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (htab->root.dynobj == NULL) htab->root.dynobj = abfd; if (!_bfd_elf_create_ifunc_sections (htab->root.dynobj, info)) - return FALSE; + return false; break; } @@ -7718,7 +7724,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, abfd, elfNN_aarch64_howto_table[howto_index].name, (h) ? h->root.root.string : "a local symbol"); bfd_set_error (bfd_error_bad_value); - return FALSE; + return false; } else break; @@ -7737,7 +7743,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, abfd, elfNN_aarch64_howto_table[howto_index].name, (h) ? h->root.root.string : "a local symbol"); bfd_set_error (bfd_error_bad_value); - return FALSE; + return false; } /* Fall through. */ @@ -7812,19 +7818,17 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, htab->root.dynobj = abfd; sreloc = _bfd_elf_make_dynamic_reloc_section - (sec, htab->root.dynobj, LOG_FILE_ALIGN, abfd, /*rela? */ TRUE); + (sec, htab->root.dynobj, LOG_FILE_ALIGN, abfd, /*rela? */ true); if (sreloc == NULL) - return FALSE; + return false; } /* If this is a global symbol, we count the number of relocations we need for this symbol. */ if (h != NULL) { - struct elf_aarch64_link_hash_entry *eh; - eh = (struct elf_aarch64_link_hash_entry *) h; - head = &eh->dyn_relocs; + head = &h->dyn_relocs; } else { @@ -7835,10 +7839,10 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *s; void **vpp; - isym = bfd_sym_from_r_symndx (&htab->sym_cache, + isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, abfd, r_symndx); if (isym == NULL) - return FALSE; + return false; s = bfd_section_from_elf_index (abfd, isym->st_shndx); if (s == NULL) @@ -7853,11 +7857,11 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, p = *head; if (p == NULL || p->sec != sec) { - bfd_size_type amt = sizeof *p; + size_t amt = sizeof *p; p = ((struct elf_dyn_relocs *) bfd_zalloc (htab->root.dynobj, amt)); if (p == NULL) - return FALSE; + return false; p->next = *head; *head = p; p->sec = sec; @@ -7920,7 +7924,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (!elfNN_aarch64_allocate_local_symbols (abfd, symtab_hdr->sh_info)) - return FALSE; + return false; locals = elf_aarch64_locals (abfd); BFD_ASSERT (r_symndx < symtab_hdr->sh_info); @@ -7963,7 +7967,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (htab->root.dynobj == NULL) htab->root.dynobj = abfd; if (! aarch64_elf_create_got_section (htab->root.dynobj, info)) - return FALSE; + return false; break; } @@ -7986,12 +7990,12 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, } } - return TRUE; + return true; } /* Treat mapping symbols as special target symbols. */ -static bfd_boolean +static bool elfNN_aarch64_is_target_special_symbol (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) { @@ -8008,43 +8012,51 @@ elfNN_aarch64_maybe_function_sym (const asymbol *sym, asection *sec, bfd_vma *code_off) { bfd_size_type size; + elf_symbol_type * elf_sym = (elf_symbol_type *) sym; if ((sym->flags & (BSF_SECTION_SYM | BSF_FILE | BSF_OBJECT | BSF_THREAD_LOCAL | BSF_RELC | BSF_SRELC)) != 0 || sym->section != sec) return 0; + size = (sym->flags & BSF_SYNTHETIC) ? 0 : elf_sym->internal_elf_sym.st_size; + if (!(sym->flags & BSF_SYNTHETIC)) - switch (ELF_ST_TYPE (((elf_symbol_type *) sym)->internal_elf_sym.st_info)) + switch (ELF_ST_TYPE (elf_sym->internal_elf_sym.st_info)) { - case STT_FUNC: case STT_NOTYPE: + /* Ignore symbols created by the annobin plugin for gcc and clang. + These symbols are hidden, local, notype and have a size of 0. */ + if (size == 0 + && sym->flags & BSF_LOCAL + && ELF_ST_VISIBILITY (elf_sym->internal_elf_sym.st_other) == STV_HIDDEN) + return 0; + /* Fall through. */ + case STT_FUNC: + /* FIXME: Allow STT_GNU_IFUNC as well ? */ break; default: return 0; } - + if ((sym->flags & BSF_LOCAL) && bfd_is_aarch64_special_symbol_name (sym->name, BFD_AARCH64_SPECIAL_SYM_TYPE_ANY)) return 0; *code_off = sym->value; - size = 0; - if (!(sym->flags & BSF_SYNTHETIC)) - size = ((elf_symbol_type *) sym)->internal_elf_sym.st_size; - if (size == 0) - size = 1; - return size; + + /* Do not return 0 for the function's size. */ + return size ? size : 1; } -static bfd_boolean +static bool elfNN_aarch64_find_inliner_info (bfd *abfd, const char **filename_ptr, const char **functionname_ptr, unsigned int *line_ptr) { - bfd_boolean found; + bool found; found = _bfd_dwarf2_find_inliner_info (abfd, filename_ptr, functionname_ptr, line_ptr, &elf_tdata (abfd)->dwarf2_find_line_info); @@ -8052,17 +8064,17 @@ elfNN_aarch64_find_inliner_info (bfd *abfd, } -static bfd_boolean +static bool elfNN_aarch64_init_file_header (bfd *abfd, struct bfd_link_info *link_info) { Elf_Internal_Ehdr *i_ehdrp; /* ELF file header, internal form. */ if (!_bfd_elf_init_file_header (abfd, link_info)) - return FALSE; + return false; i_ehdrp = elf_elfheader (abfd); i_ehdrp->e_ident[EI_ABIVERSION] = AARCH64_ELF_ABI_VERSION; - return TRUE; + return true; } static enum elf_reloc_type_class @@ -8118,7 +8130,7 @@ elfNN_aarch64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSE called when bfd_section_from_shdr finds a section with an unknown type. */ -static bfd_boolean +static bool elfNN_aarch64_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr, const char *name, int shindex) @@ -8134,13 +8146,13 @@ elfNN_aarch64_section_from_shdr (bfd *abfd, break; default: - return FALSE; + return false; } if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) - return FALSE; + return false; - return TRUE; + return true; } /* A structure used to record a list of sections, independently @@ -8251,7 +8263,7 @@ enum map_symbol_type /* Output a single mapping symbol. */ -static bfd_boolean +static bool elfNN_aarch64_output_map_sym (output_arch_syminfo *osi, enum map_symbol_type type, bfd_vma offset) { @@ -8269,7 +8281,7 @@ elfNN_aarch64_output_map_sym (output_arch_syminfo *osi, /* Output a single local symbol for a generated stub. */ -static bfd_boolean +static bool elfNN_aarch64_output_stub_sym (output_arch_syminfo *osi, const char *name, bfd_vma offset, bfd_vma size) { @@ -8284,7 +8296,7 @@ elfNN_aarch64_output_stub_sym (output_arch_syminfo *osi, const char *name, return osi->func (osi->finfo, name, &sym, osi->sec, NULL) == 1; } -static bfd_boolean +static bool aarch64_map_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct elf_aarch64_stub_hash_entry *stub_entry; @@ -8302,7 +8314,7 @@ aarch64_map_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) /* Ensure this stub is attached to the current section being processed. */ if (stub_sec != osi->sec) - return TRUE; + return true; addr = (bfd_vma) stub_entry->stub_offset; @@ -8313,32 +8325,32 @@ aarch64_map_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) case aarch64_stub_adrp_branch: if (!elfNN_aarch64_output_stub_sym (osi, stub_name, addr, sizeof (aarch64_adrp_branch_stub))) - return FALSE; + return false; if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_INSN, addr)) - return FALSE; + return false; break; case aarch64_stub_long_branch: if (!elfNN_aarch64_output_stub_sym (osi, stub_name, addr, sizeof (aarch64_long_branch_stub))) - return FALSE; + return false; if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_INSN, addr)) - return FALSE; + return false; if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_DATA, addr + 16)) - return FALSE; + return false; break; case aarch64_stub_erratum_835769_veneer: if (!elfNN_aarch64_output_stub_sym (osi, stub_name, addr, sizeof (aarch64_erratum_835769_stub))) - return FALSE; + return false; if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_INSN, addr)) - return FALSE; + return false; break; case aarch64_stub_erratum_843419_veneer: if (!elfNN_aarch64_output_stub_sym (osi, stub_name, addr, sizeof (aarch64_erratum_843419_stub))) - return FALSE; + return false; if (!elfNN_aarch64_output_map_sym (osi, AARCH64_MAP_INSN, addr)) - return FALSE; + return false; break; case aarch64_stub_none: break; @@ -8347,12 +8359,12 @@ aarch64_map_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) abort (); } - return TRUE; + return true; } /* Output mapping symbols for linker generated sections. */ -static bfd_boolean +static bool elfNN_aarch64_output_arch_local_syms (bfd *output_bfd, struct bfd_link_info *info, void *finfo, @@ -8390,7 +8402,7 @@ elfNN_aarch64_output_arch_local_syms (bfd *output_bfd, /* The first instruction in a stub is always a branch. */ if (!elfNN_aarch64_output_map_sym (&osi, AARCH64_MAP_INSN, 0)) - return FALSE; + return false; bfd_hash_traverse (&htab->stub_hash_table, aarch64_map_one_stub, &osi); @@ -8399,7 +8411,7 @@ elfNN_aarch64_output_arch_local_syms (bfd *output_bfd, /* Finally, output mapping symbols for the PLT. */ if (!htab->root.splt || htab->root.splt->size == 0) - return TRUE; + return true; osi.sec_shndx = _bfd_elf_section_from_bfd_section (output_bfd, htab->root.splt->output_section); @@ -8407,23 +8419,23 @@ elfNN_aarch64_output_arch_local_syms (bfd *output_bfd, elfNN_aarch64_output_map_sym (&osi, AARCH64_MAP_INSN, 0); - return TRUE; + return true; } /* Allocate target specific section data. */ -static bfd_boolean +static bool elfNN_aarch64_new_section_hook (bfd *abfd, asection *sec) { if (!sec->used_by_bfd) { _aarch64_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + size_t amt = sizeof (*sdata); sdata = bfd_zalloc (abfd, amt); if (sdata == NULL) - return FALSE; + return false; sec->used_by_bfd = sdata; } @@ -8441,7 +8453,7 @@ unrecord_section_via_map_over_sections (bfd *abfd ATTRIBUTE_UNUSED, unrecord_section_with_aarch64_elf_section_data (sec); } -static bfd_boolean +static bool elfNN_aarch64_close_and_cleanup (bfd *abfd) { if (abfd->sections) @@ -8451,7 +8463,7 @@ elfNN_aarch64_close_and_cleanup (bfd *abfd) return _bfd_elf_close_and_cleanup (abfd); } -static bfd_boolean +static bool elfNN_aarch64_bfd_free_cached_info (bfd *abfd) { if (abfd->sections) @@ -8465,13 +8477,13 @@ elfNN_aarch64_bfd_free_cached_info (bfd *abfd) the got, plt, gotplt and their relocation sections are all created in the standard part of the bfd elf backend. */ -static bfd_boolean +static bool elfNN_aarch64_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { /* We need to create .got section. */ if (!aarch64_elf_create_got_section (dynobj, info)) - return FALSE; + return false; return _bfd_elf_create_dynamic_sections (dynobj, info); } @@ -8480,7 +8492,7 @@ elfNN_aarch64_create_dynamic_sections (bfd *dynobj, /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ -static bfd_boolean +static bool elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; @@ -8498,7 +8510,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) called to copy all relevant data from the generic to the concrete symbol instance. */ if (h->root.type == bfd_link_hash_indirect) - return TRUE; + return true; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -8510,7 +8522,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) here if it is defined and referenced in a non-shared object. */ if (h->type == STT_GNU_IFUNC && h->def_regular) - return TRUE; + return true; else if (htab->root.dynamic_sections_created && h->plt.refcount > 0) { /* Make sure this symbol is output as a dynamic symbol. @@ -8519,7 +8531,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) && h->root.type == bfd_link_hash_undefweak) { if (!bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; + return false; } if (bfd_link_pic (info) || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) @@ -8594,7 +8606,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) if (h->got.refcount > 0) { - bfd_boolean dyn; + bool dyn; unsigned got_type = elf_aarch64_hash_entry (h)->got_type; h->got.offset = (bfd_vma) - 1; @@ -8607,7 +8619,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) && h->root.type == bfd_link_hash_undefweak) { if (!bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; + return false; } if (got_type == GOT_UNKNOWN) @@ -8667,7 +8679,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) type. */ /* TLSDESC PLT is now needed, but not yet determined. */ - htab->tlsdesc_plt = (bfd_vma) - 1; + htab->root.tlsdesc_plt = (bfd_vma) - 1; } if (got_type & GOT_TLS_GD) @@ -8683,8 +8695,8 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) h->got.offset = (bfd_vma) - 1; } - if (eh->dyn_relocs == NULL) - return TRUE; + if (h->dyn_relocs == NULL) + return true; /* In the shared -Bsymbolic case, discard space allocated for dynamic pc-relative relocs against symbols which turn out to be @@ -8704,7 +8716,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct elf_dyn_relocs **pp; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL;) + for (pp = &h->dyn_relocs; (p = *pp) != NULL;) { p->count -= p->pc_count; p->pc_count = 0; @@ -8717,11 +8729,11 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) /* Also discard relocs on undefined weak syms with non-default visibility. */ - if (eh->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak) + if (h->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak) { if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)) - eh->dyn_relocs = NULL; + h->dyn_relocs = NULL; /* Make sure undefined weak symbols are output as a dynamic symbol in PIEs. */ @@ -8729,7 +8741,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) && !h->forced_local && h->root.type == bfd_link_hash_undefweak && !bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; + return false; } } @@ -8752,7 +8764,7 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) && !h->forced_local && h->root.type == bfd_link_hash_undefweak && !bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; + return false; /* If that succeeded, we know we'll be keeping all the relocs. */ @@ -8760,13 +8772,13 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) goto keep; } - eh->dyn_relocs = NULL; + h->dyn_relocs = NULL; keep:; } /* Finally, allocate space. */ - for (p = eh->dyn_relocs; p != NULL; p = p->next) + for (p = h->dyn_relocs; p != NULL; p = p->next) { asection *sreloc; @@ -8777,19 +8789,18 @@ elfNN_aarch64_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) sreloc->size += p->count * RELOC_SIZE (htab); } - return TRUE; + return true; } /* Allocate space in .plt, .got and associated reloc sections for ifunc dynamic relocs. */ -static bfd_boolean +static bool elfNN_aarch64_allocate_ifunc_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct elf_aarch64_link_hash_table *htab; - struct elf_aarch64_link_hash_entry *eh; /* An example of a bfd_link_hash_indirect symbol is versioned symbol. For example: __gxx_personality_v0(bfd_link_hash_indirect) @@ -8801,7 +8812,7 @@ elfNN_aarch64_allocate_ifunc_dynrelocs (struct elf_link_hash_entry *h, called to copy all relevant data from the generic to the concrete symbol instance. */ if (h->root.type == bfd_link_hash_indirect) - return TRUE; + return true; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -8809,26 +8820,23 @@ elfNN_aarch64_allocate_ifunc_dynrelocs (struct elf_link_hash_entry *h, info = (struct bfd_link_info *) inf; htab = elf_aarch64_hash_table (info); - eh = (struct elf_aarch64_link_hash_entry *) h; - /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it here if it is defined and referenced in a non-shared object. */ if (h->type == STT_GNU_IFUNC && h->def_regular) return _bfd_elf_allocate_ifunc_dyn_relocs (info, h, - &eh->dyn_relocs, - NULL, + &h->dyn_relocs, htab->plt_entry_size, htab->plt_header_size, GOT_ENTRY_SIZE, - FALSE); - return TRUE; + false); + return true; } /* Allocate space in .plt, .got and associated reloc sections for local ifunc dynamic relocs. */ -static bfd_boolean +static int elfNN_aarch64_allocate_local_ifunc_dynrelocs (void **slot, void *inf) { struct elf_link_hash_entry *h @@ -8844,44 +8852,17 @@ elfNN_aarch64_allocate_local_ifunc_dynrelocs (void **slot, void *inf) return elfNN_aarch64_allocate_ifunc_dynrelocs (h, inf); } -/* Set DF_TEXTREL if we find any dynamic relocs that apply to - read-only sections. */ - -static bfd_boolean -maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) -{ - asection *sec; - - if (h->root.type == bfd_link_hash_indirect) - return TRUE; - - sec = readonly_dynrelocs (h); - if (sec != NULL) - { - struct bfd_link_info *info = (struct bfd_link_info *) info_p; - - info->flags |= DF_TEXTREL; - info->callbacks->minfo - (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), - sec->owner, h->root.root.string, sec); - - /* Not an error, just cut short the traversal. */ - return FALSE; - } - return TRUE; -} - /* This is the most important function of all . Innocuosly named though ! */ -static bfd_boolean +static bool elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) { struct elf_aarch64_link_hash_table *htab; bfd *dynobj; asection *s; - bfd_boolean relocs; + bool relocs; bfd *ibfd; htab = elf_aarch64_hash_table ((info)); @@ -8983,7 +8964,7 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, { htab->root.srelplt->size += RELOC_SIZE (htab); /* Note RELOC_COUNT not incremented here! */ - htab->tlsdesc_plt = (bfd_vma) - 1; + htab->root.tlsdesc_plt = (bfd_vma) - 1; } if (got_type & GOT_TLS_GD) @@ -9026,19 +9007,21 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->root.srelplt) htab->sgotplt_jump_table_size = aarch64_compute_jump_table_size (htab); - if (htab->tlsdesc_plt) + if (htab->root.tlsdesc_plt) { if (htab->root.splt->size == 0) htab->root.splt->size += htab->plt_header_size; /* If we're not using lazy TLS relocations, don't generate the GOT and PLT entry required. */ - if (!(info->flags & DF_BIND_NOW)) + if ((info->flags & DF_BIND_NOW)) + htab->root.tlsdesc_plt = 0; + else { - htab->tlsdesc_plt = htab->root.splt->size; + htab->root.tlsdesc_plt = htab->root.splt->size; htab->root.splt->size += htab->tlsdesc_plt_entry_size; - htab->dt_tlsdesc_got = htab->root.sgot->size; + htab->root.tlsdesc_got = htab->root.sgot->size; htab->root.sgot->size += GOT_ENTRY_SIZE; } } @@ -9055,7 +9038,7 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relocs = FALSE; + relocs = false; for (s = dynobj->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LINKER_CREATED) == 0) @@ -9072,10 +9055,10 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* Strip this section if we don't need it; see the comment below. */ } - else if (CONST_STRNEQ (bfd_section_name (s), ".rela")) + else if (startswith (bfd_section_name (s), ".rela")) { if (s->size != 0 && s != htab->root.srelplt) - relocs = TRUE; + relocs = true; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -9113,7 +9096,7 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, of garbage. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size); if (s->contents == NULL) - return FALSE; + return false; } if (htab->root.dynamic_sections_created) @@ -9126,66 +9109,32 @@ elfNN_aarch64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, #define add_dynamic_entry(TAG, VAL) \ _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (bfd_link_executable (info)) - { - if (!add_dynamic_entry (DT_DEBUG, 0)) - return FALSE; - } + if (!_bfd_elf_add_dynamic_tags (output_bfd, info, relocs)) + return false; if (htab->root.splt->size != 0) { - if (!add_dynamic_entry (DT_PLTGOT, 0) - || !add_dynamic_entry (DT_PLTRELSZ, 0) - || !add_dynamic_entry (DT_PLTREL, DT_RELA) - || !add_dynamic_entry (DT_JMPREL, 0)) - return FALSE; - if (htab->variant_pcs && !add_dynamic_entry (DT_AARCH64_VARIANT_PCS, 0)) - return FALSE; - - if (htab->tlsdesc_plt - && !(info->flags & DF_BIND_NOW) - && (!add_dynamic_entry (DT_TLSDESC_PLT, 0) - || !add_dynamic_entry (DT_TLSDESC_GOT, 0))) - return FALSE; + return false; if ((elf_aarch64_tdata (output_bfd)->plt_type == PLT_BTI_PAC) && (!add_dynamic_entry (DT_AARCH64_BTI_PLT, 0) || !add_dynamic_entry (DT_AARCH64_PAC_PLT, 0))) - return FALSE; + return false; else if ((elf_aarch64_tdata (output_bfd)->plt_type == PLT_BTI) && !add_dynamic_entry (DT_AARCH64_BTI_PLT, 0)) - return FALSE; + return false; else if ((elf_aarch64_tdata (output_bfd)->plt_type == PLT_PAC) && !add_dynamic_entry (DT_AARCH64_PAC_PLT, 0)) - return FALSE; - } - - if (relocs) - { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, RELOC_SIZE (htab))) - return FALSE; - - /* If any dynamic relocs apply to a read-only section, - then we need a DT_TEXTREL entry. */ - if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->root, maybe_set_textrel, info); - - if ((info->flags & DF_TEXTREL) != 0) - { - if (!add_dynamic_entry (DT_TEXTREL, 0)) - return FALSE; - } + return false; } } #undef add_dynamic_entry - return TRUE; + return true; } static inline void @@ -9320,14 +9269,14 @@ elfNN_aarch64_create_small_pltn_entry (struct elf_link_hash_entry *h, /* Size sections even though they're not dynamic. We use it to setup _TLS_MODULE_BASE_, if needed. */ -static bfd_boolean +static bool elfNN_aarch64_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) { asection *tls_sec; if (bfd_link_relocatable (info)) - return TRUE; + return true; tls_sec = elf_hash_table (info)->tls_sec; @@ -9336,7 +9285,7 @@ elfNN_aarch64_always_size_sections (bfd *output_bfd, struct elf_link_hash_entry *tlsbase; tlsbase = elf_link_hash_lookup (elf_hash_table (info), - "_TLS_MODULE_BASE_", TRUE, TRUE, FALSE); + "_TLS_MODULE_BASE_", true, true, false); if (tlsbase) { @@ -9346,24 +9295,24 @@ elfNN_aarch64_always_size_sections (bfd *output_bfd, if (!(_bfd_generic_link_add_one_symbol (info, output_bfd, "_TLS_MODULE_BASE_", BSF_LOCAL, - tls_sec, 0, NULL, FALSE, bed->collect, &h))) - return FALSE; + tls_sec, 0, NULL, false, bed->collect, &h))) + return false; tlsbase->type = STT_TLS; tlsbase = (struct elf_link_hash_entry *) h; tlsbase->def_regular = 1; tlsbase->other = STV_HIDDEN; - (*bed->elf_backend_hide_symbol) (info, tlsbase, TRUE); + (*bed->elf_backend_hide_symbol) (info, tlsbase, true); } } - return TRUE; + return true; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static bfd_boolean +static bool elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, struct elf_link_hash_entry *h, @@ -9403,7 +9352,7 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, || plt == NULL || gotplt == NULL || relplt == NULL) - return FALSE; + return false; elfNN_aarch64_create_small_pltn_entry (h, htab, output_bfd, info); if (!h->def_regular) @@ -9466,13 +9415,13 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, + h->plt.offset), htab->root.sgot->contents + (h->got.offset & ~(bfd_vma) 1)); - return TRUE; + return true; } } else if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h)) { if (!(h->def_regular || ELF_COMMON_DEF_P (h))) - return FALSE; + return false; BFD_ASSERT ((h->got.offset & 1) != 0); rela.r_info = ELFNN_R_INFO (0, AARCH64_R (RELATIVE)); @@ -9482,7 +9431,7 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, } else { -do_glob_dat: + do_glob_dat: BFD_ASSERT ((h->got.offset & 1) == 0); bfd_put_NN (output_bfd, (bfd_vma) 0, htab->root.sgot->contents + h->got.offset); @@ -9528,13 +9477,13 @@ do_glob_dat: || h == elf_hash_table (info)->hgot)) sym->st_shndx = SHN_ABS; - return TRUE; + return true; } /* Finish up local dynamic symbol handling. We set the contents of various dynamic sections here. */ -static bfd_boolean +static int elfNN_aarch64_finish_local_dynamic_symbol (void **slot, void *inf) { struct elf_link_hash_entry *h @@ -9571,8 +9520,11 @@ elfNN_aarch64_init_small_plt0_entry (bfd *output_bfd ATTRIBUTE_UNUSED, memcpy (htab->root.splt->contents, htab->plt0_entry, htab->plt_header_size); - elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = - htab->plt_header_size; + + /* PR 26312: Explicitly set the sh_entsize to 0 so that + consumers do not think that the section contains fixed + sized objects. */ + elf_section_data (htab->root.splt->output_section)->this_hdr.sh_entsize = 0; plt_got_2nd_ent = (htab->root.sgotplt->output_section->vma + htab->root.sgotplt->output_offset @@ -9602,7 +9554,7 @@ elfNN_aarch64_init_small_plt0_entry (bfd *output_bfd ATTRIBUTE_UNUSED, PG_OFFSET (plt_got_2nd_ent)); } -static bfd_boolean +static bool elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { @@ -9653,14 +9605,14 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, case DT_TLSDESC_PLT: s = htab->root.splt; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset - + htab->tlsdesc_plt; + + htab->root.tlsdesc_plt; break; case DT_TLSDESC_GOT: s = htab->root.sgot; - BFD_ASSERT (htab->dt_tlsdesc_got != (bfd_vma)-1); + BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1); dyn.d_un.d_ptr = s->output_section->vma + s->output_offset - + htab->dt_tlsdesc_got; + + htab->root.tlsdesc_got; break; } @@ -9674,15 +9626,11 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, { elfNN_aarch64_init_small_plt0_entry (output_bfd, htab); - elf_section_data (htab->root.splt->output_section)-> - this_hdr.sh_entsize = htab->plt_entry_size; - - - if (htab->tlsdesc_plt && !(info->flags & DF_BIND_NOW)) + if (htab->root.tlsdesc_plt && !(info->flags & DF_BIND_NOW)) { - BFD_ASSERT (htab->dt_tlsdesc_got != (bfd_vma)-1); + BFD_ASSERT (htab->root.tlsdesc_got != (bfd_vma)-1); bfd_put_NN (output_bfd, (bfd_vma) 0, - htab->root.sgot->contents + htab->dt_tlsdesc_got); + htab->root.sgot->contents + htab->root.tlsdesc_got); const bfd_byte *entry = elfNN_aarch64_tlsdesc_small_plt_entry; htab->tlsdesc_plt_entry_size = PLT_TLSDESC_ENTRY_SIZE; @@ -9693,13 +9641,14 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, entry = elfNN_aarch64_tlsdesc_small_plt_bti_entry; } - memcpy (htab->root.splt->contents + htab->tlsdesc_plt, + memcpy (htab->root.splt->contents + htab->root.tlsdesc_plt, entry, htab->tlsdesc_plt_entry_size); { bfd_vma adrp1_addr = htab->root.splt->output_section->vma - + htab->root.splt->output_offset + htab->tlsdesc_plt + 4; + + htab->root.splt->output_offset + + htab->root.tlsdesc_plt + 4; bfd_vma adrp2_addr = adrp1_addr + 4; @@ -9711,10 +9660,10 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, htab->root.sgotplt->output_section->vma + htab->root.sgotplt->output_offset; - bfd_vma dt_tlsdesc_got = got_addr + htab->dt_tlsdesc_got; + bfd_vma dt_tlsdesc_got = got_addr + htab->root.tlsdesc_got; bfd_byte *plt_entry = - htab->root.splt->contents + htab->tlsdesc_plt; + htab->root.splt->contents + htab->root.tlsdesc_plt; /* First instruction in BTI enabled PLT stub is a BTI instruction so skip it. */ @@ -9760,7 +9709,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, { _bfd_error_handler (_("discarded output section: `%pA'"), htab->root.sgotplt); - return FALSE; + return false; } /* Fill in the first three entries in the global offset table. */ @@ -9800,7 +9749,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, elfNN_aarch64_finish_local_dynamic_symbol, info); - return TRUE; + return true; } /* Check if BTI enabled PLTs are needed. Returns the type needed. */ @@ -9889,7 +9838,7 @@ elfNN_aarch64_plt_sym_val (bfd_vma i, const asection *plt, It also allows a period initiated suffix to be added to the symbol, ie: "$[adtx]\.[:sym_char]+". */ -static bfd_boolean +static bool is_aarch64_mapping_symbol (const char * name) { return name != NULL /* Paranoia. */ @@ -9936,7 +9885,7 @@ elfNN_aarch64_link_setup_gnu_properties (struct bfd_link_info *info) /* Implement elf_backend_merge_gnu_properties for AArch64. It serves as a wrapper function for _bfd_aarch64_elf_merge_gnu_properties to account for the effect of GNU properties of the output_bfd. */ -static bfd_boolean +static bool elfNN_aarch64_merge_gnu_properties (struct bfd_link_info *info, bfd *abfd, bfd *bbfd, elf_property *aprop,