| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
bfd * cpu-arm.c: (processors) Add Cortex-X1.
gas * config/tc-arm.c: (arm_cpus): Add Cortex-X1.
* doc/c-arm.texi: Document -mcpu=cortex-x1.
* testsuite/gas/arm/cpu-cortex-x1.d: New test.
|
|
|
|
|
|
|
|
|
| |
Some missing NULL checks meant a stub for a local symbol used a stub
looking like the __tls_get_addr_opt stub.
PR 26656
* elf64-ppc.c (ppc_build_one_stub, ppc_size_one_stub): Check for
NULL stub_entry->h before calling is_tls_get_addr.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The save of r2 in __glink_PLTresolve is the culprit. Remove it,
unless we know we need it for --plt-localentry. --plt-localentry
should not be used with power10 pc-relative code that makes tail
calls.
The patch also removes use of r2 as a scratch reg in the ELFv2
__glink_PLTresolve. Using r2 isn't a problem, this is just reducing
the number of scratch regs.
bfd/
* elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Depend on has_plt_localentry0.
(LD_R0_0R11, ADD_R11_R0_R11): Define.
(ppc64_elf_tls_setup): Disable params->plt_localentry0 when power10
code detected.
(ppc64_elf_size_stubs): Update __glink_PLTresolve eh_frame.
(ppc64_elf_build_stubs): Move r2 save to start of __glink_PLTresolve,
and only emit for has_plt_localentry0. Don't use r2 in the stub.
ld/
* testsuite/ld-powerpc/elfv2so.d,
* testsuite/ld-powerpc/notoc2.d,
* testsuite/ld-powerpc/tlsdesc.wf,
* testsuite/ld-powerpc/tlsdesc2.d,
* testsuite/ld-powerpc/tlsdesc2.wf,
* testsuite/ld-powerpc/tlsopt5.d,
* testsuite/ld-powerpc/tlsopt5.wf,
* testsuite/ld-powerpc/tlsopt6.d,
* testsuite/ld-powerpc/tlsopt6.wf: Update __glink_PLTresolve.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds missing support for a power10 version of the __tls_get_addr
call stub implementing DT_PPC64_OPT PPC64_OPT_TLS. Without this,
power10 code using __tls_get_addr fails miserably at runtime unless
the --no-tls-get-addr-optimize option is given.
PR 26656
* elf64-ppc.c (plt_stub_size): Add "odd" param. Use it with
size_power10_offset rather than calculating from start of stub.
Add size for notoc tls_get_addr_opt stub.
(plt_stub_pad): Add "odd" param, pass to plt_stub_size.
(build_tls_get_addr_head, build_tls_get_addr_tail): New functions.
(build_tls_get_addr_stub): Delete.
(ppc_build_one_stub): Use a temp for htab->params->stub_bfd.
Emit notoc tls_get_addr_opt stub. Move eh_frame code to
suit. Adjust code to use bfd_tls_get_addr_head/tail in place
of build_tls_get_addr_stub.
(ppc_size_one_stub): Size notoc tls_get_addr_opt stub.
Adjust plt_stub_size and plt_stub_pad calls. Correct "odd"
when padding stub. Size eh_frame for notoc stub too.
Correct lr_restore value.
(ppc64_elf_relocate_section): Don't skip over first insn of
notoc tls_get_addr_opt stub.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of the powerpc64 code editing functions are better run after
dynamic symbols have stabilised in order to make proper decisions
based on SYMBOL_REFERENCES_LOCAL. The dynamic symbols are processed
early in bfd_elf_size_dynamic_sections, before the backend
always_size_sections function is called.
One function, ppc64_elf_tls_setup must run before
bfd_elf_size_dynamic_sections because it changes dynamic symbols.
ppc64_elf_edit_opd and ppc64_elf_inline_plt can run early or late, I
think. ppc64_elf_tls_optimize and ppc64_elf_edit_toc are better run
later.
So this patch arranges to call some edit functions later via
always_size_sections.
PR 26655
bfd/
* elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to..
(ppc64_elf_edit): Call params->edit.
(ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a
bfd_boolean.
* elf64-ppc.h (struct ppc64_elf_params): Add "edit".
(ppc64_elf_tls_setup): Update declaration.
ld/
* emultempl/ppc64elf.em (params): Add ppc_edit.
(ppc_before_allocation): Split off some edit functions to..
(ppc_edit): ..this, new function.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch corrects "size" and "bitsize" in R_RISCV_RVC_* reloc howtos
so that elfnn-riscv.c:perform_relocation doesn't access past the end
of a section. I've also corrected "size" in the R_RISCV_CALL* reloc
howtos since these relocs apply to two consecutive instructions. That
caused fallout in the assembler with complaints about "fixup not
contained within frag" due to tc-riscv.c:append_insn finishing off a
frag after the auipc insn making up a "call" macro. Which is a little
rude since the CALL reloc also relocates the following jalr. Fixed by
changing the frag handling a little.
I've also changed R_RISCV_ALIGN and R_RISCV_TPREL_ADD marker reloc
howtos to look like R_RISCV_NONE, and corrected dst_mask for numerous
relocs, not that it matters very much.
bfd/
PR 26569
* elfxx-riscv.c (howto_table): Correct size and bitsize of
R_RISCV_RVC_BRANCH, R_RISCV_RVC_JUMP, and R_RISCV_RVC_LUI.
Correct size for R_RISCV_TLS_DTPMOD32, R_RISCV_TLS_DTPREL32,
R_RISCV_CALL, and R_RISCV_CALL_PLT. Make R_RISCV_TPREL_ADD and
R_RISCV_ALIGN like R_RISCV_NONE. Correct dst_mask many relocs.
gas/
* config/tc-riscv.c (append_insn): Don't tie off frags at CALL
relocs.
(riscv_call): Tie them off after the jalr.
(md_apply_fix): Zero fx_size of RELAX fixup.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
test failures on sparc-linux-gnu.
PR ld/18808
* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Skip IFUNC
relocations in debug sections, change abort to _bfd_error_handler.
|
| |
|
|
|
|
|
| |
* verilog.c (verilog_write_address): Properly handle 64-bit
addresses to avoid truncation of the high part.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PE linker calls _bfd_relocate_contents to resolve relocation, instead of
bfd_perform_relocation. But ELF linker calls bfd_perform_relocation, not
_bfd_relocate_contents. When linking PE/x86-64 inputs to generate ELF
output, we need to adjust PE/x86-64 relocations in bfd_perform_relocation.
Enable PE/x86-64 in bfd together with PEI/x86-64. Update run_ld_link_tests
to handle bzip2 binary inputs.
bfd/
PR ld/26583
* config.bfd (targ64_selvecs, targ_selvecs): Add x86_64_pe_vec
to x86_64_pei_vec.
* reloc.c: Include "coff/internal.h".
(bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.
ld/
PR ld/26583
* testsuite/ld-x86-64/pe-x86-64-1.od: New file.
* testsuite/ld-x86-64/pe-x86-64-1a.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-1b.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-1c.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-2.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-2a.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-2b.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-2c.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3a.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3b.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3c.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3d.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4a.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4b.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4c.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4d.obj.bz2: Likewise.
* testsuite/ld-x86-64/pe-x86-64.exp: Likewise.
* testsuite/lib/ld-lib.exp (run_ld_link_tests): Handle bz2 binary
inputs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bfd/
* elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter.
* elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data),
(swap_out_syms): Adjust elf_symbol_from invocation.
binutils/
* nm.c (print_symbol): Adjust elf_symbol_from invocation.
* objcopy.c (is_hidden_symbol): Likewise.
gas/
* config/obj-elf.c (obj_elf_visibility, elf_frob_symbol): Adjust
elf_symbol_from invocation.
* config/tc-aarch64.c (s_variant_pcs): Likewise.
* config/tc-m68hc11.c (s_m68hc11_mark_symbol): Likewise.
* config/tc-ppc.c (ppc_elf_localentry, ppc_force_relocation),
(ppc_fix_adjustable): Likewise.
* config/tc-xgate.c (xgate_frob_symbol): Likewise.
ld/
* plugin.c (asymbol_from_plugin_symbol): Adjust elf_symbol_from
invocation.
opcodes/
* ppc-dis.c (ppc_symbol_is_valid): Adjust elf_symbol_from invocation.
|
|
|
|
|
| |
PR 26623
* elf-bfd.h (elf_symbol_from): Exclude synthetic symbols.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For PE/x86-64, display PE relocation names:
R_X86_64_64 -> IMAGE_REL_AMD64_ADDR64
R_X86_64_32 -> IMAGE_REL_AMD64_ADDR32.
rva32 -> IMAGE_REL_AMD64_ADDR32NB
R_X86_64_PC32 -> IMAGE_REL_AMD64_REL32
DISP32+1 -> IMAGE_REL_AMD64_REL32_1
DISP32+2 -> IMAGE_REL_AMD64_REL32_2
DISP32+3 -> IMAGE_REL_AMD64_REL32_3
DISP32+4 -> IMAGE_REL_AMD64_REL32_4
DISP32+5 -> IMAGE_REL_AMD64_REL32_5
secrel32 -> IMAGE_REL_AMD64_SECREL
bfd/
* coff-x86_64.c (howto_table): Display PE relocation names.
gas/
* testsuite/gas/cfi/reloc-pe-i386.d: Updated.
* testsuite/gas/i386/x86-64-w64-pcrel.d: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not sure why there wasn't a NULL check in the ld/22269 patch
(e01c16a8) at the time, as there was one for the corresponding patch
to elf32-m68k.c (5056ba1d).
Incidentally, I had missed that in 2017, as a prerequisite for the
ld/22269 series, the check_relocs function finally were made "safe"!
(I.e. the number of references and symbol types are final, garbage
collection done, so port-specific accounting can be made sanely.)
Committed.
bfd:
PR ld/26589
* elf32-cris.c (cris_elf_check_relocs): Add missing NULL check
on argument before calling UNDEFWEAK_NO_DYNAMIC_RELOC.
ld:
PR ld/26589
* testsuite/ld-elf/pr26589.d, testsuite/ld-elf/locref3.s: New test.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The symbol string table in the .symtab section is optional and cosmetic.
The contents of the .symtab section have no impact on run-time execution.
The symbol names in the symbol string table help distinguish addresses at
different locations. Add a linker option, -z unique-symbol, to avoid
duplicated local symbol names in the symbol string table.
This feature was well received by the livepatch maintainers. It not only
solves the duplicated local symbol name problem, but also would allow
livepatch to more precisely locate duplicate symbols in general for
patching.
bfd/
PR ld/26391
* elflink.c (elf_final_link_info): Add local_hash_table.
(local_hash_entry): New.
(local_hash_newfunc): Likewise.
(elf_link_output_symstrtab): Append ".COUNT" to duplicated local
symbols.
(bfd_elf_final_link): Initialize and free local_hash_table for
"-z unique-symbol".
include/
PR ld/26391
* bfdlink.h (bfd_link_info): Add unique_symbol.
ld/
PR ld/26391
* NEWS: Mention "-z unique-symbol".
* emultempl/elf.em (gld${EMULATION_NAME}_handle_option): Handle
"-z unique-symbol" and "-z nounique-symbol".
* ld.texi: Document "-z unique-symbol" and "-z nounique-symbol".
* lexsup.c (elf_static_list_options): Add "-z unique-symbol" and
"-z nounique-symbol".
* testsuite/ld-elf/elf.exp: Add PR ld/26391 tests.
* testsuite/ld-elf/pr26391.nd: New file.
* testsuite/ld-elf/pr26391.out: Likewise.
* testsuite/ld-elf/pr26391a.c: Likewise.
* testsuite/ld-elf/pr26391b.c: Likewise.
* testsuite/ld-elf/pr26391c.c: Likewise.
* testsuite/ld-elf/pr26391d.c: Likewise.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fix in 7e05773767820b441b23a16628b55c98cb1aef46 introduced a PLT
for conditional jumps when the target symbol is undefined. This is
incorrect because conditional branch relocations are not allowed to
clobber IP0/IP1 and hence, should not result in a dynamic relocation.
Revert that change and in its place, issue an error when the target
symbol is undefined.
bfd/
2020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
changes in 7e05773767820b441b23a16628b55c98cb1aef46. Set
error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
BFD_RELOC_AARCH64_TSTBR14 relocations.
ld/
2020-09-10 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
* testsuite/ld-aarch64/emit-relocs-560.d: Expect error instead
of valid output.
|
| |
|
|
|
|
|
| |
* cofflink.c (coff_link_check_archive_element): Move the check for
coff type input to the start of the function.
|
| |
|
|
|
|
|
|
|
| |
Put the prototype where it won't disappear on the next regen of libbfd.h.
* libbfd-in.h (_bfd_write_unsigned_leb128): Declare.
* libbfd.h: Regenerate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Link-time relaxations of branches are common for MSP430, given that GCC
can generate pessimal branch instructions, and the
-mcode-region=either/-mdata-region=either options to shuffle sections
can further change the type of branch instruction required.
These relaxations can result in invalid code when .uleb128
directives, used in the .gcc_except_table section, are used to calculate
the distance between two labels. A value for the .uleb128 directive is
calculated at assembly-time, and can't be updated at link-time, even if
relaxation causes the distance between the labels to change.
This patch adds relocations for subtract expressions in .uleb128
directives, to allow the linker to re-calculate the value of these
expressions after relaxation has been performed.
bfd/ChangeLog:
* bfd-in2.h (bfd_reloc_code_real): Add
BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
* elf32-msp430.c (msp430_elf_ignore_reloc): New.
(elf_msp430_howto_table): Add R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
(msp430_reloc_map): Add R_MSP430_GNU_{SET,SUB}_ULEB128.
(msp430x_reloc_map): Add R_MSP430X_GNU_{SET,SUB}_ULEB128.
(write_uleb128): New.
(msp430_final_link_relocate): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
* libbfd.c (_bfd_write_unsigned_leb128): New.
* libbfd.h (_bfd_write_unsigned_leb128): New prototype.
Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
* reloc.c: Document BFD_RELOC_MSP430_{SET,SUB}_ULEB128.
binutils/ChangeLog:
* readelf.c (target_specific_reloc_handling): Handle
R_MSP430{,X}_GNU_{SET,SUB}_ULEB128.
gas/ChangeLog:
* config/tc-msp430.c (msp430_insert_uleb128_fixes): New.
(msp430_md_end): Call msp430_insert_uleb128_fixes.
include/ChangeLog:
* elf/msp430.h (elf_msp430_reloc_type): Add
R_MSP430_GNU_{SET,SUB}_ULEB128.
(elf_msp430x_reloc_type): Add R_MSP430X_GNU_{SET,SUB}_ULEB128.
ld/ChangeLog:
* testsuite/ld-msp430-elf/msp430-elf.exp: Run new tests.
* testsuite/ld-msp430-elf/uleb128.s: New test.
* testsuite/ld-msp430-elf/uleb128_430.d: New test.
* testsuite/ld-msp430-elf/uleb128_430x.d: New test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the basic infrastructure needed to support Armv8-R in
AArch64 binutils: new command-line flags, new feature bits, a new BFD
architecture, and support for differentiating between architecture
variants in the disassembler.
The new command-line options added by this patch are -march=armv8-r in
GAS and -m aarch64:armv8-r in objdump.
The disassembler support is necessary since Armv8-R AArch64 introduces a
system register (VSCTLR_EL2) which shares an encoding with a different
system register (TTBR0_EL2) in Armv8-A. This also allows us to use the
correct preferred disassembly for the new DFB alias introduced in
Armv8-R.
bfd/ChangeLog:
2020-09-08 Alex Coplan <alex.coplan@arm.com>
* archures.c (bfd_mach_aarch64_8R): New.
* bfd-in2.h: Regenerate.
* cpu-aarch64.c (bfd_aarch64_arch_v8_r): New.
(bfd_aarch64_arch_ilp32): Update tail pointer.
gas/ChangeLog:
2020-09-08 Alex Coplan <alex.coplan@arm.com>
* config/tc-aarch64.c (aarch64_archs): Add armv8-r.
* doc/c-aarch64.texi: Document -march=armv8-r.
include/ChangeLog:
2020-09-08 Alex Coplan <alex.coplan@arm.com>
* opcode/aarch64.h (AARCH64_FEATURE_V8_A): New.
(AARCH64_FEATURE_V8_R): New.
(AARCH64_ARCH_V8): Include new A-profile feature bit.
(AARCH64_ARCH_V8_R): New.
opcodes/ChangeLog:
2020-09-08 Alex Coplan <alex.coplan@arm.com>
* aarch64-dis.c (arch_variant): New.
(determine_disassembling_preference): Disassemble according to
arch variant.
(select_aarch64_variant): New.
(print_insn_aarch64): Set feature set.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two pieces to this puzzle:
1) Revert HJ's fix for PR13250 so that size and alignment isn't
sticky, instead attack the real underlying problem that
_bfd_generic_link_add_one_symbol does the wrong thing in making a
common section in a shared library bfd.
2) Save and restore common u.c.p fields, which hold the section and
alignment.
A better fix for (2) would be to throw away all of that horrible code
saving and restoring the hash table when loading as-needed library
symbols, and instead do a scan over as-needed library symbols before
adding anything.
bfd/
PR 13250
PR 26580
* elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**.
Return oldbfd in override when old common should override new
common.
(_bfd_elf_add_default_symbol): Adjust to suit.
(elf_link_add_object_symbols): Likewise. Pass "override" to
_bfd_generic_link_add_one_symbol. Save and restore common u.c.p
field for --as-needed shared libraries. Revert pr13250 changes.
ld/
* testsuite/ld-elf/pr26580-a.s,
* testsuite/ld-elf/pr26580-b.s,
* testsuite/ld-elf/pr26580-1.sd,
* testsuite/ld-elf/pr26580-2.sd: New tests
* testsuite/ld-elf/comm-data.exp: Run new tests.
* testsuite/ld-elf/pr26580-a.c,
* testsuite/ld-elf/pr26580-b.c,
* testsuite/ld-elf/pr26580-3.out,
* testsuite/ld-elf/pr26580-4.out: New tests.
* testsuite/ld-elf/shared.exp: Run new tests.
|
|
|
|
|
|
|
| |
conanicalizing weak definitions.
* plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
unrecognized symbol type in a weak definition.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A horribly fuzzed object with section headers inside the ELF header.
Disallow that, and crazy reloc sizes.
PR 26574
* elfcode.h (elf_object_p): Sanity check section header offset.
* elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
sh_entsize.
|