Age | Commit message (Collapse) | Author | Files | Lines |
|
There are quite a few duplicated code supporting several GP based
relocation types. They are:
BFD_RELOC_AARCH64_LD64_GOTOFF_LO15
BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC
BFD_RELOC_AARCH64_MOVW_GOTOFF_G1
These relocation types are supposed to be used for large memory model PIC/pic
mode under which we will have an initialized GP register points to the base of
GOT table, then these relocations are supposed to put the distance between GOT
entry and GOT table base address into the related instructions.
So, the parameters required to calculate the relocation should be the same as
BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15 etc, all of them are require the GOT entry
address and GOT table base address to perform the relocation.
This patch has removed those duplicated code when handling above listed
relocation types, grouped them with others as relocation types that are
require GOT table base address during performing relocation, reused the
existed GOT handling code.
The relocation calculation for these types before and after this patch should be
identical.
bfd/
* elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
(elfNN_aarch64_final_link_relocate): Delete duplicated code for
BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
support for them.
|
|
R_AARCH64_TLSDESC_ADD_LO12_NC to R_AARCH64_TLSDESC_ADD_LO12.
PR binutils/21202
include * elf/aarch64.h (R_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
R_AARCH64_TLSDESC_LD64_LO12.
(R_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
R_AARCH64_TLSDESC_ADD_LO12_NC.
bfd * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
(BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
names.
(IS_AARCH64_TLSDESC_RELOC): Likewise.
(elfNN_aarch64_howto_table): Likewise.
(aarch64_tls_transition_without_check): Likewise.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_tls_relax): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
gas * config/tc-aarch64.c (reloc_table): Rename
BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC to
BFD_RELOC_AARCH64_TLSDESC_LD64_LO12. Rname
BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC to
BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
(md_apply_fix): Likewise.
(aarch64_force_relocation): Likewise.
* testsuite/gas/aarch64/tls.d: Update regexp.
ld * testsuite/ld-aarch64/ifunc-5r-local.d: Update regexp.
|
|
|
|
Comment changes.
bfd/
* coff-h8300.c: Spell fall through comments consistently.
* coffgen.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf64-ppc.c: Likewise.
* elfxx-aarch64.c: Likewise.
* elfxx-mips.c: Likewise.
* cpu-ns32k.c: Add missing fall through comments.
* elf-m10300.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-avr.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-frv.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-microblaze.c: Likewise.
* elf32-nds32.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-rl78.c: Likewise.
* elf32-rx.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-tic6x.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-x86-64.c: Likewise.
* elflink.c: Likewise.
* elfnn-aarch64.c: Likewise.
* elfnn-ia64.c: Likewise.
* ieee.c: Likewise.
* oasys.c: Likewise.
* pdp11.c: Likewise.
* srec.c: Likewise.
* versados.c: Likewise.
opcodes/
* aarch64-opc.c: Spell fall through comments consistently.
* i386-dis.c: Likewise.
* aarch64-dis.c: Add missing fall through comments.
* aarch64-opc.c: Likewise.
* arc-dis.c: Likewise.
* arm-dis.c: Likewise.
* i386-dis.c: Likewise.
* m68k-dis.c: Likewise.
* mep-asm.c: Likewise.
* ns32k-dis.c: Likewise.
* sh-dis.c: Likewise.
* tic4x-dis.c: Likewise.
* tic6x-dis.c: Likewise.
* vax-dis.c: Likewise.
binutils/
* dlltool.c: Spell fall through comments consistently.
* objcopy.c: Likewise.
* readelf.c: Likewise.
* dwarf.c: Add missing fall through comments.
* elfcomm.c: Likewise.
* sysinfo.y: Likewise.
* readelf.c: Likewise. Also remove extraneous comments.
gas/
* app.c: Add missing fall through comments.
* dw2gencfi.c: Likewise.
* expr.c: Likewise.
* config/tc-alpha.c: Likewise.
* config/tc-arc.c: Likewise.
* config/tc-arm.c: Likewise.
* config/tc-cr16.c: Likewise.
* config/tc-crx.c: Likewise.
* config/tc-dlx.c: Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-hppa.c: Likewise.
* config/tc-i370.c: Likewise.
* config/tc-i386.c: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-ia64.c: Likewise.
* config/tc-m68hc11.c: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-mep.c: Likewise.
* config/tc-metag.c: Likewise.
* config/tc-microblaze.c: Likewise.
* config/tc-mips.c: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-rx.c: Likewise.
* config/tc-score.c: Likewise.
* config/tc-score7.c: Likewise.
* config/tc-sh.c: Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-vax.c: Likewise.
* config/tc-xstormy16.c: Likewise.
* config/tc-z80.c: Likewise.
* config/tc-z8k.c: Likewise.
* config/obj-elf.c: Likewise.
* config/tc-i386.c: Likewise.
* depend.c: Spell fall through comments consistently.
* config/tc-arm.c: Likewise.
* config/tc-d10v.c: Likewise.
* config/tc-i960.c: Likewise.
* config/tc-ia64.c: Likewise.
* config/tc-m68k.c: Likewise.
* config/tc-mcore.c: Likewise.
* config/tc-mep.c: Likewise.
* config/tc-ns32k.c: Likewise.
* config/tc-visium.c: Likewise.
* config/tc-xstormy16.c: Likewise.
* config/tc-z8k.c: Likewise.
gprof/
* gprof.c: Add missing fall through comments.
ld/
* lexsup.c: Spell fall through comments consistently and add
missing fall through comments.
|
|
Take STB_GNU_UNIQUE handling scattered across targets and gather it in
the generic ELF linker. Update test suite infrastructure accordingly.
bfd/
* elf-s390-common.c (elf_s390_add_symbol_hook): Remove
STB_GNU_UNIQUE handling.
* elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
* elf32-arm.c (elf32_arm_add_symbol_hook): Likewise.
* elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
* elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
* elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
* elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
* elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
* elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
* elf32-i386.c (elf_i386_add_symbol_hook): Remove function.
(elf_backend_add_symbol_hook): Remove macro.
* elflink.c (elf_link_add_object_symbols): Set `has_gnu_symbols'
for STB_GNU_UNIQUE symbols.
binutils/
* testsuite/lib/binutils-common.exp (supports_gnu_unique): New
procedure.
* testsuite/binutils-all/objcopy.exp: Use `supports_gnu_unique'
with the `strip-10' test.
ld/
* testsuite/ld-unique/unique.exp: Use `is_elf_format' and
`supports_gnu_unique' to qualify testing.
|
|
|
|
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (aarch64_tls_transition_without_check): Add
relax transitions for TLSDESC_ADD, TLSDESC_LDR, TLSDESC_OFF_G0_NC,
TLSDESC_OFF_G1.
(aarch64_tls_transition_without_check): Add relaxation support.
(aarch64_reloc_got_type): Add support.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_tls_relax): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/aarch64-elf.exp: Run new test.
* ld-aarch64/tls-large-desc.d: New.
* ld-aarch64/tls-large-desc.s: New.
* ld-aarch64/tls-relax-large-desc-ie.d: New.
* ld-aarch64/tls-relax-large-desc-ie.s: New.
* ld-aarch64/tls-relax-large-desc-le.d: New.
* ld-aarch64/tls-relax-large-desc-le.s: New.
|
|
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
* libbfd.h: Regenerate.
* bfd-in2.h: Likewise.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
TLSIE_MOVW_GOTTPREL_G1 check overflow.
(aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
and TLSIE_MOVW_GOTTPREL_G0_NC.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
gas/
2015-10-02 Renlin Li <renlin.li@arm.com>
* config/tc-aarch64.c (reloc_table): Add two entries for
gottprel_g0_nc and gottprel_g1.
(process_movw_reloc_info): Add support.
(md_apply_fix): Likewise.
(aarch64_force_relocation): Likewise.
gas/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* gas/aarch64/reloc-gottprel_g0_nc.d: New.
* gas/aarch64/reloc-gottprel_g0_nc.s: New.
* gas/aarch64/reloc-gottprel_g1.d: New.
* gas/aarch64/reloc-gottprel_g1.s: New.
ld/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/tls-large-ie.d: New.
* ld-aarch64/tls-large-ie.s: New.
* ld-aarch64/aarch64-elf.exp: Run new test.
|
|
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (aarch64_reloc_got_type): Add
BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC support.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/emit-relocs-516.d: New.
* ld-aarch64/emit-relocs-516.s: New.
* ld-aarch64/aarch64-elf.exp: Run new test.
|
|
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (aarch64_reloc_got_type): Add
BFD_RELOC_AARCH64_TLSGD_MOVW_G1 support.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/emit-relocs-515.d: New.
* ld-aarch64/emit-relocs-515.s: New.
* ld-aarch64/aarch64-elf.exp: Run new test.
|
|
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (aarch64_reloc_got_type): Add
BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC support.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/aarch64-elf.exp: Run new test.
* ld-aarch64/emit-relocs-301.d: New.
* ld-aarch64/emit-relocs-301.s: New.
|
|
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (aarch64_reloc_got_type): Add support
for BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise
(elfNN_aarch64_final_link_relocate): Calculate offset within GOT.
ld/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/emit-relocs-302.d: New.
* ld-aarch64/emit-relocs-302.s: New.
* ld-aarch64/aarch64-elf.exp: Run the new test.
|
|
bfd/
2015-10-02 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (aarch64_reloc_got_type): Add
BFD_RELOC_AARCH64_LD_64_GOTOFF_LO15 support.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise
(elfNN_aarch64_final_link_relocate): Calculate offset within GOT.
ld/testsuite/
2015-10-02 Renlin Li <renlin.li@arm.com>
* ld-aarch64/emit-relocs-310.d: New.
* ld-aarch64/emit-relocs-310.s: New.
* ld-aarch64/aarch64-elf.exp: Run the test.
|
|
2015-08-19 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
(elfNN_aarch64_final_link_relocate): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/emit-relocs-531.s: New testcase.
* ld-aarch64/emit-relocs-531-overflow.s: Likewise.
* ld-aarch64/emit-relocs-532.s: Likewise.
* ld-aarch64/emit-relocs-533.s: Likewise.
* ld-aarch64/emit-relocs-533-overflow.s: Likewise.
* ld-aarch64/emit-relocs-534.s: Likewise.
* ld-aarch64/emit-relocs-535.s: Likewise.
* ld-aarch64/emit-relocs-535-overflow.s: Likewise.
* ld-aarch64/emit-relocs-536.s: Likewise.
* ld-aarch64/emit-relocs-537.s: Likewise.
* ld-aarch64/emit-relocs-537-overflow.s: Likewise.
* ld-aarch64/emit-relocs-538.s: Likewise.
* ld-aarch64/emit-relocs-531.d: New expectation file.
* ld-aarch64/emit-relocs-531-overflow.d: Likewise.
* ld-aarch64/emit-relocs-532.d: Likewise.
* ld-aarch64/emit-relocs-533.d: Likewise.
* ld-aarch64/emit-relocs-533-overflow.d: Likewise.
* ld-aarch64/emit-relocs-534.d: Likewise.
* ld-aarch64/emit-relocs-535.d: Likewise.
* ld-aarch64/emit-relocs-535-overflow.d: Likewise.
* ld-aarch64/emit-relocs-536.d: Likewise.
* ld-aarch64/emit-relocs-537.d: Likewise.
* ld-aarch64/emit-relocs-537-overflow.d: Likewise.
* ld-aarch64/emit-relocs-538.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
|
|
2015-08-19 Jiong Wang <jiong.wang@arm.com>
bfd/
PR ld/18276
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
(elfNN_aarch64_final_link_relocate): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/emit-relocs-87.s: New testcase.
* ld-aarch64/emit-relocs-88.s: Likewise.
* ld-aarch64/emit-relocs-88-overflow.s: Likewise.
* ld-aarch64/emit-relocs-89.s: Likewise.
* ld-aarch64/emit-relocs-90.s: Likewise.
* ld-aarch64/emit-relocs-90-overflow.s: Likewise.
* ld-aarch64/emit-relocs-523.s: Likewise.
* ld-aarch64/emit-relocs-524.s: Likewise.
* ld-aarch64/emit-relocs-525.s: Likewise.
* ld-aarch64/emit-relocs-527.s: Likewise.
* ld-aarch64/emit-relocs-526.s: Likewise.
* ld-aarch64/emit-relocs-528.s: Likewise.
* ld-aarch64/emit-relocs-528-overflow.s: Likewise.
* ld-aarch64/emit-relocs-87.d: New expectation file.
* ld-aarch64/emit-relocs-88.d: Likewise.
* ld-aarch64/emit-relocs-88-overflow.d: Likewise.
* ld-aarch64/emit-relocs-89.d: Likewise.
* ld-aarch64/emit-relocs-90.d: Likewise.
* ld-aarch64/emit-relocs-90-overflow.d: Likewise.
* ld-aarch64/emit-relocs-91.d: Likewise.
* ld-aarch64/emit-relocs-523.d: Likewise.
* ld-aarch64/emit-relocs-524.d: Likewise.
* ld-aarch64/emit-relocs-525.d: Likewise.
* ld-aarch64/emit-relocs-526.d: Likewise.
* ld-aarch64/emit-relocs-527.d: Likewise.
* ld-aarch64/emit-relocs-528.d: Likewise.
* ld-aarch64/emit-relocs-528-overflow.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
|
|
2015-08-19 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/emit-relocs-530.s: New testcase.
* ld-aarch64/emit-relocs-92.s: Likewise.
* ld-aarch64/emit-relocs-530.d: New expectation file.
* ld-aarch64/emit-relocs-92.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
|
|
Since the backend elf_add_symbol_hook isn't called on local symbols,
the EI_OSABI field isn't to ELFOSABI_GNU where are local IFUNC symbols.
This patch changes the x86 backends to set has_gnu_symbols if there are
relocations against IFUNC symbols. Other backends with IFUNC support
may need a similar change.
This patch also changes the type of has_gnu_symbols from bfd_boolean to
enum elf_gnu_symbols.
bfd/
PR ld/18815
* elf-bfd.h (elf_gnu_symbols): New enum.
(elf_obj_tdata): Use elf_gnu_symbols on has_gnu_symbols.
* elf-s390-common.c (elf_s390_add_symbol_hook): Set
has_gnu_symbols to elf_gnu_symbol_any.
* elf32-arm.c (elf32_arm_add_symbol_hook): Likewise.
* elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
* elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
* elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
* elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
* elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
* lfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
* elf32-i386.c (elf_i386_check_relocs): Update has_gnu_symbols
if there are relocations against IFUNC symbols.
(elf_i386_add_symbol_hook): Don't check STT_GNU_IFUNC here.
* elf64-x86-64. (elf_x86_64_check_relocs): Update has_gnu_symbols
if there are relocations against IFUNC symbols.
(elf_x86_64_add_symbol_hook): Don't check STT_GNU_IFUNC here.
ld/testsuite/
PR ld/18815
* ld-i386/i386.exp: Run pr18815.
* ld-x86-64/x86-64.exp: Likewise.
* ld-i386/pr18815.d: New file.
* ld-i386/pr18815.s: Likewise.
* ld-x86-64/pr18815.d: Likewise.
* ld-x86-64/pr18815.s: Likewise.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/emit-relocs-529.s: New testcase.
* ld-aarch64/emit-relocs-529-overflow.s: Likewise.
* ld-aarch64/emit-relocs-86.s: Likewise.
* ld-aarch64/emit-relocs-86-overflow.s: Likewise.
* ld-aarch64/emit-relocs-529.d: New expectation file.
* ld-aarch64/emit-relocs-529-overflow.d: Likewise.
* ld-aarch64/emit-relocs-86.d: Likewise.
* ld-aarch64/emit-relocs-86-overflow.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new testcases.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/tls-small-ld.s: Update testcase.
|
|
2015-08-11 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
(aarch64_reloc_got_type): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/testsuite/
* ld-aarch64/tls-small-ld.s: New file.
* ld-aarch64/tls-small-ld.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new test.
|
|
|
|
This patch add BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 relocation
supoprt in bfd linker.
2015-06-01 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (aarch64_reloc_got_type): Support
BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
(elfNN_aarch64_final_link_relocate): Ditto.
(elfNN_aarch64_gc_swap_hook): Ditto.
(elfNN_aarch64_check_relocs): Ditto.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
ld/testsuite/
* ld-aarch64/emit-relocs-28.s: New test file.
* ld-aarch64/emit-relocs-28.d: Ditto.
* ld-aarch64/aarch64-elf.exp: Run new test.
|
|
BFD_RELOC_AARCH64_TLSLE_ADD_LO12 is used to generate simplest
one-instruction addressing for TLS LE model when tls size is smaller
4K. Linker need to make sure there is no TLS offset overflow.
2015-06-01 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Set overflow type to
complain_overflow_unsigned for BFD_RELOC_AARCH64_TLSLE_ADD_LO12.
* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Don't use
PGOFF for BFD_RELOC_AARCH64_TLSLE_ADD_LO12, that will mask off all
potential high overflowed bits.
ld/testsuite/
* ld-aarch64/tprel_add_lo12_overflow.s: New testcase.
* ld-aarch64/tprel_add_lo12_overflow.d: Nex expectation file.
* ld-aarch64/aarch64-elf.exp: Run new testcase.
|
|
2015-06-01 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (aarch64_reloc_got_type): Support
BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
(elfNN_aarch64_final_link_relocate): Ditto.
(elfNN_aarch64_gc_swap_hook): Ditto.
(elfNN_aarch64_check_relocs): Ditto.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
ld/testsuite/
* ld-aarch64/emit-relocs-313.s: New test file.
* ld-aarch64/emit-relocs-313.d: Ditto.
* ld-aarch64/aarch64-elf.exp: Run new test.
|
|
2015-05-19 Jiong Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (aarch64_tls_transition_without_check): Sort
relocation case labels alphabetically.
(elfNN_aarch64_final_link_relocate): Ditto.
(elfNN_aarch64_tls_relax): Ditto.
(elfNN_aarch64_relocate_section): Ditto.
(elfNN_aarch64_gc_sweep_hook): Ditto.
(elfNN_aarch64_check_relocs): Ditto.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Ditto.
(_bfd_aarch64_elf_resolve_relocation): Ditto.
|
|
Some early revisions of the Cortex-A53 have an erratum (843419). The
details of the erratum are quite complex and involve dynamic
conditions. For the purposes of the workaround we have simplified the
static conditions to an ADRP in the last two instructions of a 4KByte
page, followed within four instructions by a load/store dependent on
the ADRP.
This patch adds support to conservatively scan for and workaround
Cortex A53 erratum 843419. There are two different workaround
strategies used. The first is to rewrite ADRP instructions which form
part of an erratum sequence with an ADR instruction. In situations
where the ADR provides insufficient offset the dependent load or store
instruction from the sequence is moved to a stub section and branches
are inserted from the original sequence to the relocated instruction
and back again.
Stub section sizes are rounded up to a multiple of 4096 in order to
ensure that the act of inserting work around stubs does not create
more errata sequences.
Workaround stubs are always inserted into the stub section associated
with the input section containing the erratum sequence. This ensures
that the fully relocated form of the veneered load store instruction
is available at the point in time when the stub section is written.
|
|
Removing a group of unused functions from the AArch64 BFD backend.
|
|
bfd/
PR gas/17843
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
to be used with MOVK rather than MOVZ.
gas/
PR gas/17843
* config/tc-aarch64.c (process_movw_reloc_info): Allow
R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
for MOVK.
gas/testsuite/
PR gas/17843
* gas/aarch64/tls.s, gas/aarch64/tls.d: Add test for
R_AARCH64_TLSLE_MOVW_TPREL_G0/R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
sequence.
ld/testsuite/
PR gas/17843
* ld-aarch64/tlsle.s, ld-aarch64/tlsle.d: New test.
* ld-aarch64/aarch64-elf.exp: Run it.
|
|
|
|
|
|
|
|
|
|
Commit ec93045b and cd21f5da introduced a large number of tic4x and
tic54x regressions, due to the new checks being wrong for targets
with octets_per_byte != 1. To fix that I introduced a new
bfd_get_section_limit_octets and performed the check on octets rather
than byte adresses, reducing the number of bfd_octets_per_byte calls.
bfd_octets_per_byte is rather expensive..
I then wondered why the same bfd_reloc_outofrange check added to
bfd_perform_relocation wasn't also added to bfd_install_relocation.
The two functions are virtually identical and ought to remain that
way. However, adding the same check to bfd_install_relocation
resulted in ld-elf "FAIL Link eh-group.o to eh-group" on many ELF
targets, including x64_64-linux. The reason being that eh-group.o
has NONE relocs at the end of a section, and most targets give NONE
relocs a non-zero size. So if we are to keep the new outofrange
check it appears that NONE relocs must have a zero size.
* bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
(bfd_get_section_limit): ..here.
* reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
(bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
* elf32-sh.c (sh_elf_reloc): Correct bfd_reloc_outofrange check.
* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Remove duplicated
bfd_reloc_outofrange check.
* bfd-in2.h: Regenerate.
* cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
on zero size relocs.
* ecoff.c (ecoff_reloc_link_order): Likewise.
* elf32-nds32.c (nds32_relocate_contents): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
* reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
(_bfd_clear_contents): Likewise.
* elfxx-mips.c (mips_elf_obtain_contents): Likewise.
(mips_elf_perform_relocation): Likewise.
* aoutx.h (aout_link_reloc_link_order): Allow for NULL return
from malloc on zero size alloc.
* cofflink.c (_bfd_coff_reloc_link_order): Likewise.
* elflink.c (elf_reloc_link_order): Likewise.
* linker.c (_bfd_generic_reloc_link_order): Likewise.
* pdp11.c (aout_link_reloc_link_order): Likewise.
* xcofflink.c (xcoff_reloc_link_order): Likewise.
* aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
bitsize 0, and complain_overflow_dont.
* coff-sparc.c (coff_sparc_howto_table): Likewise.
* elf-hppa.h (elf_hppa_howto_table): Likewise.
* elf-m10200.c (elf_mn10200_howto_table): Likewise.
* elf-m10300.c (elf_mn10300_howto_table): Likewise.
* elf32-arc.c (elf_arc_howto_table): Likewise.
* elf32-arm.c (elf32_arm_howto_table_1): Likewise.
* elf32-avr.c (elf_avr_howto_table): Likewise.
* elf32-bfin.c (bfin_howto_table): Likewise.
* elf32-cr16.c (cr16_elf_howto_table): Likewise.
* elf32-cris.c (cris_elf_howto_table): Likewise.
* elf32-crx.c (crx_elf_howto_table): Likewise.
* elf32-d10v.c (elf_d10v_howto_table): Likewise.
* elf32-d30v.c (elf_d30v_howto_table): Likewise.
* elf32-dlx.c (dlx_elf_howto_table): Likewise.
* elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
* elf32-fr30.c (fr30_elf_howto_table): Likewise.
* elf32-frv.c (elf32_frv_howto_table): Likewise.
* elf32-h8300.c (h8_elf_howto_table): Likewise.
* elf32-i370.c (i370_elf_howto_raw): Likewise.
* elf32-i386.c (elf_howto_table): Likewise.
* elf32-i860.c (elf32_i860_howto_table): Likewise.
* elf32-i960.c (elf32_i960_relocate): Likewise.
* elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
* elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
* elf32-lm32.c (lm32_elf_howto_table): Likewise.
* elf32-m32c.c (m32c_elf_howto_table): Likewise.
* elf32-m32r.c (m32r_elf_howto_table): Likewise.
* elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
* elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
* elf32-m68k.c (howto_table): Likewise.
* elf32-mcore.c (mcore_elf_howto_raw): Likewise.
* elf32-mep.c (mep_elf_howto_table): Likewise.
* elf32-metag.c (elf_metag_howto_table): Likewise.
* elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
* elf32-mips.c (elf_mips_howto_table_rel): Likewise.
* elf32-moxie.c (moxie_elf_howto_table): Likewise.
* elf32-msp430.c (elf_msp430_howto_table): Likewise.
* elf32-mt.c (mt_elf_howto_table): Likewise.
* elf32-nds32.c (nds32_elf_howto_table): Likewise.
* elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
* elf32-or1k.c (or1k_elf_howto_table): Likewise.
* elf32-pj.c (pj_elf_howto_table): Likewise.
* elf32-ppc.c (ppc_elf_howto_raw): Likewise.
* elf32-rl78.c (rl78_elf_howto_table): Likewise.
* elf32-rx.c (rx_elf_howto_table): Likewise.
* elf32-s390.c (elf_howto_table): Likewise.
* elf32-score.c (elf32_score_howto_table): Likewise.
* elf32-score7.c (elf32_score_howto_table): Likewise.
* elf32-sh-relocs.h (R_SH_NONE): Likewise.
* elf32-spu.c (elf_howto_table): Likewise.
* elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
* elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
* elf32-v850.c (v850_elf_howto_table): Likewise.
* elf32-vax.c (howto_table): Likewise.
* elf32-visium.c (visium_elf_howto_table): Likewise.
* elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
* elf32-xgate.c (elf_xgate_howto_table): Likewise.
* elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
* elf32-xtensa.c (elf_howto_table): Likewise.
* elf64-alpha.c (elf64_alpha_howto_table): Likewise.
* elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
* elf64-mmix.c (elf_mmix_howto_table): Likewise.
* elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
* elf64-s390.c (elf_howto_table): Likewise.
* elf64-sh64.c (sh_elf64_howto_table): Likewise.
* elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
* elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
(elfNN_aarch64_howto_none): Likewise.
* elfxx-ia64.c (ia64_howto_table): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
* elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
* nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
|
|
bfd/
PR ld/17415
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark
R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned.
* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the bit
mask.
ld/testsuite/
PR ld/17415
* ld-aarch64/pr17415.s: Source file for new test.
* ld-aarch64/pr17415.d: Expect file for new test.
* ld-aarch64/aarch64-elf.exp: Run the new test.
|
|
|
|
PR 17492
* elf32-arm.c (elf32_arm_add_symbol_hook): Only set has_gnu_symbols
on ELF output bfd.
* elf32-i386.c (elf_i386_add_symbol_hook): Likewise.
* elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
* elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
* elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
* elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
* elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
* elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
* elf-s390-common.c (elf_s390_add_symbol_hook): Likewise. Handle
STB_GNU_UNIQUE too.
|
|
* elfxx-aarch64.c (stdarg.h): Include.
(string.h): Include.
(_bfd_aarch64_elf_grok_prstatus): Updated.
(_bfd_aarch64_elf_grok_psinfo): New function.
(_bfd_aarch64_elf_write_core_note): New function.
* elfxx-aarch64.h (elf_backend_grok_psinfo): Define.
(elf_backend_write_core_note): Define.
|
|
|
|
size of struct elf_prstatus.
|
|
bfd/
* Makefile.am (BFD64_BACKENDS): Add elfxx-aarch64.c.
(BFD64_BACKENDS_CFILES): Add elfxx-aarch64.lo.
* Makefile.in: Re-generated.
* configure.in (bfd_elf64_bigaarch64_vec): Add elfxx-aarch64.lo.
(bfd_elf64_littleaarch64_vec): Likewise.
(bfd_elf32_bigaarch64_vec): Likewise.
(bfd_elf32_littleaarch64_vec): Likewise.
* configure: Re-generated.
* elfxx-aarch64.c: New file; split from elf64-aarch64.c.
* elfxx-aarch64.h: New file.
* elfnn-aarch64.c: Include "elfxx-aarch64.h"; move the following
stuff to elfxx-aarch64.c.
(bfd_elf_aarch64_put_addend): Removed.
(PG_OFFSET, PG): Likewise.
(elfNN_aarch64_small_plt0_entry): Support ELF32.
(elfNN_aarch64_tlsdesc_small_plt_entry): Likewise.
(elf64_aarch64_grok_prstatus): Removed.
(elf_backend_grok_prstatus): Removed.
(insn32): Likewise.
(aarch64_unsigned_overflow): Likewise.
(aarch64_signed_overflow): Likewise.
(aarch64_resolve_relocation): Likewise.
(MASK): Likewise.
(decode_branch_ofs_26): Likewise.
(decode_cond_branch_ofs_19): Likewise.
(decode_ld_lit_ofs_19): Likewise.
(decode_tst_branch_ofs_14): Likewise.
(decode_movw_imm): Likewise.
(decode_adr_imm): Likewise.
(decode_add_imm): Likewise.
(reencode_branch_ofs_26): Likewise.
(reencode_cond_branch_ofs_19): Likewise.
(reencode_ld_lit_ofs_19): Likewise.
(reencode_tst_branch_ofs_14): Likewise.
(reencode_movw_imm): Likewise.
(reencode_adr_imm): Likewise.
(reencode_ldst_pos_imm): Likewise.
(reencode_add_imm): Likewise.
(reencode_movzn_to_movz): Likewise.
(reencode_movzn_to_movn): Likewise.
(aarch64_relocate): Update to call the new function names in
elfxx-aarch64.c.
(aarch64_calculate_got_entry_vma): Likewise.
(elfNN_aarch64_final_link_relocate): Likewise.
(elf64_aarch64_update_plt_entry): Likewise; change the type of the
parameter 'r_type' to bfd_reloc_code_real_type; rename to ...
(elf_aarch64_update_plt_entry): ... this.
(elfNN_aarch64_create_small_pltn_entry): Update.
(elfNN_aarch64_init_small_plt0_entry): Remove plt_got_base; add
bfd_vma plt_got_2nd_ent; update to call elf_aarch64_update_plt_entry.
(elfNN_aarch64_finish_dynamic_sections): Add plt_entry; update to
call elf_aarch64_update_plt_entry.
|