]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 10 Sep 2020 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 9 Sep 2020 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 8 Sep 2020 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 7 Sep 2020 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 6 Sep 2020 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 5 Sep 2020 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 4 Sep 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoPartially fix a quadratic slowdown when processing secondary relocations for inputs...
Nick Clifton [Thu, 3 Sep 2020 15:00:48 +0000 (16:00 +0100)] 
Partially fix a quadratic slowdown when processing secondary relocations for inputs with lots of sections.

PR 26406
* elf-bfd.h (struct bfd_elf_section_data): Add
has_secondary_relocs field.
* elf.c (_bfd_elf_copy_special_section_fields): Set the
has_secondary_relocs field for sections which have associated
secondary relocs.
* elfcode.h (elf_write_relocs): Only call write_secondary_relocs
on sections which have associated secondary relocs.

4 years agoImport a patch from mainline to fix a spurious overflow error when decoding negative...
Nick Clifton [Thu, 3 Sep 2020 14:52:53 +0000 (15:52 +0100)] 
Import a patch from mainline to fix a spurious overflow error when decoding negative LEB128 values.

PR 26548
* dwarf.c (read_leb128): When checking for overflow of a signed
read, use a signed shift.

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 3 Sep 2020 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 2 Sep 2020 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 1 Sep 2020 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 31 Aug 2020 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 30 Aug 2020 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 29 Aug 2020 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 28 Aug 2020 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 27 Aug 2020 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoopcodes: Add missing entries to ebpf_isa_attr
Jose E. Marchesi [Wed, 26 Aug 2020 14:48:39 +0000 (16:48 +0200)] 
opcodes: Add missing entries to ebpf_isa_attr

opcodes/

* disassemble.c (enum epbf_isa_attr): Add ISA_XBPFBE, ISA_EBPFMAX.

(cherry picked from commit 31b3f3e6e42083e411c47e789eb617070d5ba0e4)

4 years agobpf: add xBPF ISA
Jose E. Marchesi [Wed, 26 Aug 2020 13:46:09 +0000 (15:46 +0200)] 
bpf: add xBPF ISA

This patch adds support for xBPF, another ISA targetting the BPF
virtual architecture. For now, the primary difference between eBPF
and xBPF is that xBPF supports indirect calls through the
'call %reg' form of the call instruction.

bfd/
* archures.c (bfd_mach_xbpf): Define.
* bfd-in2.h: Regenerate.
* cpu-bpf.c (bfd_xbpf_arch) New.
(bfd_bpf_arch) Update next in list field to point to xbpf arch.

cpu/
* bpf.cpu (arch bpf): Add xbpf mach and isas.
(define-xbpf-isa) New pmacro.
(all-isas) Add xbpfle,xbpfbe.
(endian-isas): New pmacro.
(mach xbpf): New.
(model xbpf-def): Likewise.
(h-gpr): Add xbpf mach.
(f-dstle, f-srcle, dstle, srcle): Add xbpfle isa.
(f-dstbe, f-srcbe, dstbe, srcbe): Add xbpfbe isa.
(define-alu-insn-un): Use new endian-isas pmacro.
(define-alu-insn-bin, define-alu-insn-mov): Likewise.
(define-endian-insn, define-lddw): Likewise.
(dlind, dxli, dxsi, dsti): Likewise.
(define-cond-jump-insn, define-call-insn): Likewise.
(define-atomic-insns): Likewise.

gas/
* config/tc-bpf.c: Add option -mxbpf to select xbpf isa.
* testsuite/gas/bpf/indcall-1.d: New file.
* testsuite/gas/bpf/indcall-1.s: Likewise.
* testsuite/gas/bpf/indcall-bad-1.l: Likewise.
* testsuite/gas/bpf/indcall-bad-1.s: Likewise.
* testsuite/gas/bpf/bpf.exp: Run new tests.

opcodes/
* bpf-desc.c: Regenerate.
* bpf-desc.h: Likewise.
* bpf-opc.c: Likewise.
* bpf-opc.h: Likewise.
* disassemble.c (disassemble_init_for_target): Set bits for xBPF
ISA when appropriate.

(cherry picked from commit 4449c81a85eef44b10532032207e8db5858c00ee)

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 26 Aug 2020 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoBackport patches from the mainline to fix the handling of DWARF-5 debug information:
Nick Clifton [Tue, 25 Aug 2020 14:39:00 +0000 (15:39 +0100)] 
Backport patches from the mainline to fix the handling of DWARF-5 debug information:

binutils* testsuite/binutils-all/readelf.exp (readelf_wi_test): Also
recognize DW_LANG_C11.

bfd *  dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
and dwarf_rnglists_size fields.
(dwarf_debug_sections): Add debug_rnglists.
(dwarf_debug_section_enum): Likewise.
(read_debug_rnglists): New function.
(read_rangelist): New function to call either read_ranges or
read_rnglists. Rename original function to...
(read_ranges): ...this.
(read_rnglists): New function.

* dwarf2.c (read_attribute_value): Handle DW_FORM_data16.
(read_formatted_entries): Likewise. And skip zero entry.

4 years agoBackport patches from the mainline to fix bugs in the assembler's support for DWARF-5.
Nick Clifton [Tue, 25 Aug 2020 13:00:42 +0000 (14:00 +0100)] 
Backport patches from the mainline to fix bugs in the assembler's support for DWARF-5.

2020-08-04  Mark Wielaard  <mark@klomp.org>

* dwarf2dbg.c (out_debug_abbrev): When DWARF2_VERSION >= 4, use
DW_FORM_udata for DW_AT_high_pc.
(out_debug_info): Use emit_leb128_expr for DW_AT_high_pc, when
DWARF2_VERSION >= 4.
* read.c (emit_leb128_exp): No longer static.
* read.h (emit_leb128_exp): Define.

2020-08-02  Mark Wielaard  <mark@klomp.org>

* gas/dwarf2dbg.c (out_dir_and_file_list): For DWARF5 emit at
least one directory if there is at least one file. Use dirs[1]
if dirs[0] is not set, or if there is no dirs[1] the current
working directory. Use files[1] filename, when files[0] filename
isn't set.

2020-08-02  Mark Wielaard  <mark@klomp.org>

* dwarf2dbg.c (out_debug_info): Emit unit type and abbrev offset
for DWARF5.
* gas/testsuite/gas/elf/dwarf-4-cu.d: New file.
* gas/testsuite/gas/elf/dwarf-4-cu.s: Likewise.
* gas/testsuite/gas/elf/dwarf-5-cu.d: Likewise.
* gas/testsuite/gas/elf/dwarf-5-cu.s: Likewise.
* testsuite/gas/elf/elf.exp: Run dwarf-4-cu and dwarf-5-cu.

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 25 Aug 2020 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 24 Aug 2020 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 23 Aug 2020 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 22 Aug 2020 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 21 Aug 2020 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Aug 2020 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Aug 2020 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoPowerPC: Rename xvcvbf16sp to xvcvbf16spn
Peter Bergner [Tue, 18 Aug 2020 17:42:31 +0000 (12:42 -0500)] 
PowerPC: Rename xvcvbf16sp to xvcvbf16spn

The xvcvbf16sp mnemonic has been renamed to xvcvbf16spn, to be consistent
with the other non-signaling conversion instructions which all end with "n".

opcodes/
Backported from master:
2020-08-18  Peter Bergner  <bergner@linux.ibm.com>

* ppc-opc.c (powerpc_opcodes) <xvcvbf16sp>: Rename from this...
<xvcvbf16spn>: ...to this.

gas/
Backported from master:
2020-08-18  Peter Bergner  <bergner@linux.ibm.com>

* testsuite/gas/ppc/vsx4.s: Update test to use new mnemonic.
* testsuite/gas/ppc/vsx4.d: Likewise.

(cherry picked from commit f5fc30d05c7e2aaba4fe892ab52fbf0930342dac)

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 18 Aug 2020 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 17 Aug 2020 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agold: Add a PR binutils/26389 test
H.J. Lu [Sun, 16 Aug 2020 12:45:02 +0000 (05:45 -0700)] 
ld: Add a PR binutils/26389 test

PR binutils/26389
* testsuite/ld-plugin/lto.exp: Run PR binutils/26389 test.
* testsuite/ld-plugin/pr26389.c: New file.
* testsuite/ld-plugin/pr26389.d: Likewise.

(cherry picked from commit 246b9ea1983d59c8b0070746a904a6b3f8d62187)

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 16 Aug 2020 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoPR26389, nm prints "c" for a common symbol with -flto and -fcommon
Alan Modra [Sat, 15 Aug 2020 00:12:44 +0000 (09:42 +0930)] 
PR26389, nm prints "c" for a common symbol with -flto and -fcommon

git commit 49d9fd42acef chose to make nm print 'C' for the normal
common section, and 'c' for other commons.  This was an attempt to
make common symbols in .scommon and other small common sections show
a 'c' type without a section name comparison, but it failed for
nm --plugin on lto objects where normal common symbols are stashed in
a "plug" section.  It's also wrong for large common symbols.  So
instead set SEC_SMALL_DATA on sections created for small commons, and
key off that flag to show 'c' type.  If your ELF target doesn't have
an elf_backend_symbol_processing function, then you won't see 'c' for
symbols in .scommon.

Note that due to bfd_decode_symclass decoding common symbols without
a chance for coff_section_type to treat .scommon specially, then
having .scommon in the array of special sections handled by
coff_section_type prior to 49d9fd42acef was entirely ineffective.
That fact escaped me when writing 49d9fd42acef.  Unless .scommon
didn't have SEC_IS_COMMON set, which would be a little weird.

PR 26389
* syms.c (bfd_decode_symclass): Choose 'c' for commons only when
SEC_SMALL_DATA.
* elf32-m32r.c (_bfd_m32r_elf_symbol_processing): Set SEC_SMALL_DATA
on small common section.
* elf32-score.c (s3_bfd_score_elf_symbol_processing): Likewise.
* elf32-score7.c (s7_bfd_score_elf_symbol_processing): Likewise.
* elf32-tic6x.c (elf32_tic6x_symbol_processing): Likewise.
* elf32-v850.c (v850_elf_symbol_processing): Likewise.
* elfxx-mips.c (_bfd_mips_elf_symbol_processing): Likewise.
* ecoff.c (ecoff_set_symbol_info, ecoff_link_add_externals): Likewise.

(cherry picked from commit 4d1823674eedf267c7cafac2b923256db0b10ac8)

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 15 Aug 2020 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoArm: Fix IT-predicated MVE vcvt
Joe Ramsay [Fri, 14 Aug 2020 07:00:03 +0000 (08:00 +0100)] 
Arm: Fix IT-predicated MVE vcvt

This patch fixes an incorrect parsing of vcvtne for MVE. Even when it appeared
in an IT block, vcvtne would be parsed as a VPT-predicated vcvtn, instead of an
IT-predicated vcvt. This change extends the existing handling of MVE vcvt to
properly account for IT predication.

gas/ChangeLog:

2020-08-13  Joe Ramsay  <joe.ramsay@arm.com>

Backported from master
2020-08-04  Joe Ramsay <joe.ramsay@.arm.com>

* config/tc-arm.c (do_neon_cvt_1): Parse vcvtne as vcvt-ne for
NS_FD shape when MVE is present
* testsuite/gas/arm/mve-vcvtne-it-bad.d: New test.
* testsuite/gas/arm/mve-vcvtne-it-bad.l: New test.
* testsuite/gas/arm/mve-vcvtne-it-bad.s: New test.
* testsuite/gas/arm/mve-vcvtne-it.d: New test.
* testsuite/gas/arm/mve-vcvtne-it.s: New test.

4 years agoAArch64: Relax thumb-plt testcases regexpr.
Tamar Christina [Fri, 14 Aug 2020 06:51:03 +0000 (07:51 +0100)] 
AArch64: Relax thumb-plt testcases regexpr.

The regexpr in these two files are a bit strict in that they don't account for
the slight changes in tags in certain arm targets which cause our address
offsets to change.   This changes the tests to allow slight movement in
locations while still strictly checking the rest.

ld/ChangeLog:

2020-08-03  Tamar Christina  <tamar.christina@arm.com>

* testsuite/ld-arm/thumb-plt-got.d: Relax regexpr.
* testsuite/ld-arm/thumb-plt.d: Likewise.

(cherry picked from commit 95c210664d3eedad480fbade0eceb81af796259d)

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 14 Aug 2020 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 13 Aug 2020 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agobpf: add missing tests from previous commits
Jose E. Marchesi [Wed, 12 Aug 2020 13:42:40 +0000 (15:42 +0200)] 
bpf: add missing tests from previous commits

2020-08-07  David Faust  <david.faust@oracle.com>

* testsuite/ld-bpf/call-3.s: New file.
* testsuite/ld-bpf/call-3.d: Likewise.

4 years agobpf: fix false overflow in eBPF ELF backend linker
Jose E. Marchesi [Wed, 12 Aug 2020 13:42:24 +0000 (15:42 +0200)] 
bpf: fix false overflow in eBPF ELF backend linker

When performing DISP{16,32} relocations, the eBPF ELF backend linker
needs to convert the relocation from an address into a signed number
of 64-bit words (minus one) to jump.

Because of this unsigned-to-signed conversion, special care needs to
be taken when dividing to ensure the sign bits remain correct.
Otherwise, a false relocation overflow error can be triggered.

bfd/ChangeLog

2020-08-07  David Faust  <david.faust@oracle.com>

* elf64-bpf.c (bpf_elf_relocate_section): Ensure signed division for
DISP16 and DISP32 relocations.

ld/ChangeLog

2020-08-07  David Faust  <david.faust@oracle.com>

* testsuite/ld-bpf/call-3.s: New file.
* testsuite/ld-bpf/call-3.d: Likewise.

4 years agobpf: relocation fixes for eBPF ELF backend
Jose E. Marchesi [Wed, 12 Aug 2020 13:41:34 +0000 (15:41 +0200)] 
bpf: relocation fixes for eBPF ELF backend

The eBPF ELF backend was not properly recording relocation addends
during installation, nor reading and applying them when performing
the final relocation. This lead to various issues with incorrect
relocations.

These issues are fixed with a new howto special function to install
the relocations, and updates to bpf_elf_relocate_section to read and
use the addends as recorded in the input_bfd.

bfd/ChangeLog

2020-08-05  David Faust  <david.faust@oracle.com>

* elf64-bpf.c (bpf_elf_generic_reloc): New function.
(bpf_elf_howto_table): Use it here.
(bpf_elf_relocate_section): Use addends recorded in input_bfd for
instruction and data relocations.

ld/ChangeLog

2020-08-05  David Faust  <david.faust@oracle.com>

* testsuite/ld-bpf/call-2.s: New file.
* testsuite/ld-bpf/call-2.d: Likewise.
* testsuite/ld-bpf/reloc-data-be.d: Likewise.
* testsuite/ld-bpf/reloc-data-le.d: Likewise.
* testsuite/ld-bpf/reloc-data.s: Likewise.
* testsuite/ld-bpf/reloc-insn-external-be.d: Likewise.
* testsuite/ld-bpf/reloc-insn-external-le.d: Likewise.
* testsuite/ld-bpf/reloc-insn-external.s: Likewise.
* testsuite/ld-bpf/reloc-insn32-be.d: Likewise.
* testsuite/ld-bpf/reloc-insn32-le.d: Likewise.
* testsuite/ld-bpf/reloc-insn32.s: Likewise.
* testsuite/ld-bpf/reloc-insn64-be.d: Likewise.
* testsuite/ld-bpf/reloc-insn64-le.d: Likewise.
* testsuite/ld-bpf/reloc-insn64.s: Likewise.

4 years agoRemove spurious text in changelog entry
Nick Clifton [Wed, 12 Aug 2020 10:28:52 +0000 (11:28 +0100)] 
Remove spurious text in changelog entry

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 12 Aug 2020 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 11 Aug 2020 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 10 Aug 2020 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 9 Aug 2020 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 8 Aug 2020 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 7 Aug 2020 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 6 Aug 2020 00:00:21 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 5 Aug 2020 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agogas/NEWS: Mention {disp16} pseudo prefix
H.J. Lu [Tue, 4 Aug 2020 12:55:31 +0000 (05:55 -0700)] 
gas/NEWS: Mention {disp16} pseudo prefix

* NEWS: Mention {disp16} pseudo prefix.

(cherry picked from commit 789198ca955f924c7928c016d922c68e3e2e6dae)

5 years agox86: Add {disp16} pseudo prefix
H.J. Lu [Thu, 30 Jul 2020 23:13:02 +0000 (16:13 -0700)] 
x86: Add {disp16} pseudo prefix

Use Prefix_XXX for pseudo prefixes.  Add {disp16} pseudo prefix and
replace {disp32} pseudo prefix with {disp16} in 16-bit mode test.
Check invalid {disp16}/{disp32} pseudo prefixes.

gas/

PR gas/26305
* config/tc-i386.c (_i386_insn::disp_encoding): Add
disp_encoding_16bit.
(parse_insn): Check Prefix_XXX for pseudo prefixes.  Handle
{disp16}.
(build_modrm_byte): Handle {disp16}.
(i386_index_check): Check invalid {disp16} and {disp32} pseudo
prefixes.
* doc/c-i386.texi: Update {disp32} documentation and document
{disp16}.
* testsuite/gas/i386/i386.exp: Run x86-64-inval-pseudo.
* testsuite/gas/i386/inval-pseudo.s: Add {disp32}/{disp16}
tests.
* testsuite/gas/i386/pseudos.s: Add {disp8}/{disp32} vmovaps
tests with 128-byte displacement.  Add {disp16} tests.
* testsuite/gas/i386/x86-64-pseudos.s: Add {disp8}/{disp32}
vmovaps test.  Add (%r13)/(%r13d) tests.
* testsuite/gas/i386/x86-64-inval-pseudo.l: New file.
* testsuite/gas/i386/x86-64-inval-pseudo.s: Likewise.
* testsuite/gas/i386/inval-pseudo.l: Updated.
* testsuite/gas/i386/pseudos.d: Likewise.
* testsuite/gas/i386/x86-64-pseudos.d: Likewise.

opcodes/

PR gas/26305
* i386-opc.h (Prefix_Disp8): New.
(Prefix_Disp16): Likewise.
(Prefix_Disp32): Likewise.
(Prefix_Load): Likewise.
(Prefix_Store): Likewise.
(Prefix_VEX): Likewise.
(Prefix_VEX3): Likewise.
(Prefix_EVEX): Likewise.
(Prefix_REX): Likewise.
(Prefix_NoOptimize): Likewise.
* i386-opc.tbl: Use Prefix_XXX on pseudo prefixes.  Add {disp16}.
* i386-tbl.h: Regenerated.

(cherry picked from commit 41eb8e88859b297f59f4d093aab9306d4b7057d9)

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 4 Aug 2020 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoUse xmalloc rather than malloc
Alan Modra [Mon, 3 Aug 2020 01:29:38 +0000 (10:59 +0930)] 
Use xmalloc rather than malloc

As far as I can tell, the following comment is false nowadays.
/* Calls to m-alloc get turned by sed into xm-alloc.  */

Remove it, and call xmalloc.

* ldlex.l (yy_create_string_buffer): Use xmalloc rather than malloc.
* lexsup.c (parse_args): Likewise.

(cherry picked from commit ee44c2ac7b3efdfd28c41cd32d7fb935b0582a97)

5 years agoPR26328, Compilation warning when building ld v2.35 with MinGW
Alan Modra [Mon, 3 Aug 2020 01:28:11 +0000 (10:58 +0930)] 
PR26328, Compilation warning when building ld v2.35 with MinGW

PR 26328
* configure.ac: AC_CHECK_DECLS asprintf.
* configure: Regenerate.
* config.in: Regenerate.

(cherry picked from commit bfd133d0d8432d80ea1cbfc1fc38adee0d502ba3)

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 3 Aug 2020 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 2 Aug 2020 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 1 Aug 2020 00:00:24 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 31 Jul 2020 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoaarch64: set sh_entsize of .plt to 0
Szabolcs Nagy [Wed, 29 Jul 2020 14:47:50 +0000 (15:47 +0100)] 
aarch64: set sh_entsize of .plt to 0

On aarch64 the first PLT entry is 32 bytes, subsequent entries
are 16 bytes by default but can be 24 bytes with BTI or with
PAC-PLT.

sh_entsize of .plt was set to the PLT entry size, so in some
cases sh_size % sh_entsize != 0, which breaks some tools.

Note that PLT0 (and the TLSDESC stub code which is also in the
PLT) were historically not padded up to meet the sh_size
requirement, but to ensure that PLT stub code is aligned on
cache lines. Similar layout is present on other targets too
which just happens to make sh_size a multiple of sh_entsize and
it is not expected that sh_entsize of .plt is used for anything.

This patch sets sh_entsize of .plt to 0: the section does not
hold a table of fixed-size entries so other values are not
conforming in principle to the ELF spec.

bfd/ChangeLog:

PR ld/26312
* elfnn-aarch64.c (elfNN_aarch64_init_small_plt0_entry): Set sh_entsize
to 0.
(elfNN_aarch64_finish_dynamic_sections): Remove sh_entsize setting.

(cherry picked from commit 4d3bb35620e70d543d438bf21be1307f7ea0f5d0)

5 years agoDefault to DWARF level 3 in the assembler.
Nick Clifton [Thu, 30 Jul 2020 14:00:38 +0000 (15:00 +0100)] 
Default to DWARF level 3 in the assembler.

* as.c (dwatf_level): Default to level 3 in case version is not
set on the command line.

5 years agoDefault to DWARF level 4 in the assembler.
Nick Clifton [Thu, 30 Jul 2020 07:45:04 +0000 (08:45 +0100)] 
Default to DWARF level 4 in the assembler.

 * as.c (dwatf_level): Default to level 4 in case version is not
   set on the command line.

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 30 Jul 2020 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 29 Jul 2020 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agox86: Handle {disp32} for (%bp)/(%ebp)/(%rbp)
H.J. Lu [Tue, 28 Jul 2020 10:41:16 +0000 (03:41 -0700)] 
x86: Handle {disp32} for (%bp)/(%ebp)/(%rbp)

Since (%bp)/(%ebp)/(%rbp) are encoded as 0(%bp)/0(%ebp)/0(%rbp), use
disp32/disp16 on 0(%bp)/0(%ebp)/0(%rbp) for {disp32}.

Note: Since there is no disp32 on 0(%bp), use disp16 instead.

PR gas/26305
* config/tc-i386.c (build_modrm_byte): Use disp32/disp16 on
(%bp)/(%ebp)/(%rbp) for {disp32}.
* doc/c-i386.texi: Update {disp32} documentation.
* testsuite/gas/i386/pseudos.s: Add (%bp)/(%ebp) tests.
* testsuite/gas/i386/x86-64-pseudos.s: Add (%ebp)/(%rbp) tests.
* testsuite/gas/i386/pseudos.d: Updated.
* testsuite/gas/i386/x86-64-pseudos.d: Likewise.

(cherry picked from commit 1a02d6b0ff80048df106cbb776a550278f8c9d9c)

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 28 Jul 2020 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 27 Jul 2020 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 26 Jul 2020 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Jul 2020 00:00:22 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoSet version to 2.35.0 and enable development
Nick Clifton [Fri, 24 Jul 2020 11:05:01 +0000 (12:05 +0100)] 
Set version to 2.35.0 and enable development

5 years ago2.35 Release binutils-2_35
Nick Clifton [Fri, 24 Jul 2020 09:36:01 +0000 (10:36 +0100)] 
2.35 Release

5 years agoUpdated German translation for the opcodes sub-directory
Nick Clifton [Fri, 24 Jul 2020 09:13:45 +0000 (10:13 +0100)] 
Updated German translation for the opcodes sub-directory

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Jul 2020 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoPR ld/26288: Allow the use of `--just-symbols' with ET_EXEC input
Maciej W. Rozycki [Thu, 23 Jul 2020 19:24:58 +0000 (20:24 +0100)] 
PR ld/26288: Allow the use of `--just-symbols' with ET_EXEC input

Fix a regression from commit a87e1817a435 ("Have the linker fail if any
attempt to link in an executable is made.") and do not reject ET_EXEC
input supplied with the `--just-symbols' option.  Such use is legitimate
as the file requested is not actually linked and only the symbols are
extracted. Furthermore it is often the most useful application, as
already observed in our documentation for the option, where it allows
"to refer symbolically to absolute locations of memory defined in other
programs."

Provide a set of tests for the use of ET_EXEC with `--just-symbols'.
These are excluded however for SH/PE targets because they complain if a
section's VMA is 0:

ld: zero vma section reloc detected: `.text' #0 f=32795
ld: zero vma section reloc detected: `.data' #1 f=291

and for x86_64/PE targets because they seem to hardwire the VMA:

 100000000 12000000 01000000 00000000 00000000  ................

ld/
PR ld/26288
* ldelf.c (ldelf_after_open): Do not reject ET_EXEC input
supplied with `--just-symbols'.
* testsuite/ld-misc/just-symbols.exp: New test script.
* testsuite/ld-misc/just-symbols-1.dd: New test dump.
* testsuite/ld-misc/just-symbols.ld: New test linker script.
* testsuite/ld-misc/just-symbols-0.s: New test source.
* testsuite/ld-misc/just-symbols-1.s: New test source.

(cherry picked from commit 97c79e2174fbb0dda16850fa5366592e93d31cb9)

5 years agoPR ld/26288: Revert obsolete part of PR ld/26047 fix
Maciej W. Rozycki [Thu, 23 Jul 2020 19:24:58 +0000 (20:24 +0100)] 
PR ld/26288: Revert obsolete part of PR ld/26047 fix

Revert commit a3fc941881e4 ("Stop the linker from accepting executable
ELF files as inputs to other links."), which has been made obsolete by
commit a87e1817a435 ("Have the linker fail if any attempt to link in an
executable is made.").  An earlier check triggers added with the latter
commit making the piece of code removed dead.

ld/
PR ld/26288

Revert:
PR 26047
* ldelf.c (ldelf_after_open): Fail if attempting to link one
executable into another.

(cherry picked from commit b5dd7120f6bcbd1fe650b8839a53b2bd423fbf60)

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Jul 2020 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agold: Properly override the IR definition
H.J. Lu [Wed, 22 Jul 2020 10:49:07 +0000 (03:49 -0700)] 
ld: Properly override the IR definition

We change the previous definition in the IR object to undefweak only
after all LTO symbols have been read.

include/

PR ld/26262
PR ld/26267
* bfdlink.h (bfd_link_info): Add lto_all_symbols_read.

ld/

PR ld/26262
PR ld/26267
* ldlang.c (lang_process): Set lto_all_symbols_read after all
LTO IR symbols have been read.
* plugin.c (plugin_notice): Override the IR definition only if
all LTO IR symbols have been read or the new definition is
non-weak and the the IR definition is weak
* testsuite/ld-plugin/lto.exp: Run PR ld/26262 and ld/26267
tests.
* testsuite/ld-plugin/pr26262a.c: New file.
* testsuite/ld-plugin/pr26262b.c: Likewise.
* testsuite/ld-plugin/pr26262c.c: Likewise.
* testsuite/ld-plugin/pr26267.err: Likewise.
* testsuite/ld-plugin/pr26267a.c: Likewise.
* testsuite/ld-plugin/pr26267b.c: Likewise.
* testsuite/ld-plugin/pr26267c.c: Likewise.

(cherry picked from commit 0e6a3f07f50723d1831291492b96fdf74bcbdc11)

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Jul 2020 00:00:23 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 21 Jul 2020 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoFix a problem with a few PowerPC linker tests when the .data section is retained.
Nick Clifton [Mon, 20 Jul 2020 13:59:39 +0000 (14:59 +0100)] 
Fix a problem with a few PowerPC linker tests when the .data section is retained.

* testsuite/ld-powerpc/powerpc.exp (ppcelftests): Use section name
.PPC.EMB.apuinfo instead of section number 2 in apuinfo tests.

5 years agox86: Update PR gas/26263 linker tests
H.J. Lu [Mon, 20 Jul 2020 11:53:58 +0000 (04:53 -0700)] 
x86: Update PR gas/26263 linker tests

Update and run PR gas/26263 linker tests for all x86 ELF targets to
accept any program header layout.

PR gas/26263
* testsuite/ld-i386/pr26263.d: Updated.
* testsuite/ld-x86-64/pr26263.d: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run gas/26263 test for all ELF
targets.

(cherry picked from commit 98b3697bcdedb92739d8feb9b881efdd70fd40d3)

5 years agoAutomatic date update in version.in
GDB Administrator [Mon, 20 Jul 2020 00:00:25 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agox86: Change PLT32 reloc against section to PC32
H.J. Lu [Sun, 19 Jul 2020 13:51:19 +0000 (06:51 -0700)] 
x86: Change PLT32 reloc against section to PC32

Commit 292676c1 resolved PLT32 reloc aganst local symbol to section.
Since PLT32 relocation must be against symbols, turn such PLT32
relocation into PC32 relocation.

gas/

PR gas/26263
* config/tc-i386.c (i386_validate_fix): Change PLT32 reloc
against section to PC32 reloc.
* testsuite/gas/i386/relax-5.d: Updated.
* testsuite/gas/i386/x86-64-relax-4.d: Likewise.

ld/

PR gas/26263
* testsuite/ld-i386/i386.exp: Run PR gas/26263 test.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr26263.d: New file.
* testsuite/ld-x86-64/pr26263.d: Likewise.
* testsuite/ld-x86-64/pr26263.s: Likewise.

(cherry picked from commit 2585b7a5ce5830e60a089aa2316a329558902f0c)

5 years agoPower10 stub selection
Alan Modra [Fri, 17 Jul 2020 07:17:28 +0000 (16:47 +0930)] 
Power10 stub selection

This patch better supports mixing of power10 and non-power10 code,
as might be seen in a cpu-optimized library using ifuncs to select
functions optimized for a given cpu.  Using -Wl,--no-power10-stubs
isn't that good in this situation since non-power10 notoc stubs are
slower and larger than the power10 variants, which you'd like to use
on power10 code paths.

With this change, power10 pc-relative code that makes calls marked
@notoc uses power10 stubs if stubs are necessary, and other calls use
non-power10 instructions in stubs.  This will mean that if gcc is
generating code for -mcpu=power10 but with pc-rel disabled then you'll
get the older stubs even on power10 (unless you force with
-Wl,--power10-stubs).  That shouldn't be too big a problem: stubs that
use r2 are reasonable.  It's just the ones that set up addressing
using "mflr 12; bcl 20,31,.+4; mflr 11; mtlr 12" that should be
avoided if possible.

bfd/
* elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
(select_alt_stub): New function.
(ppc_get_stub_entry): Use it here.
(ppc64_elf_check_relocs): Set had_power10_relocs rather than
power10_stubs.
(ppc64_elf_size_stubs): Clear power10_stubs here instead.  Don't
merge notoc stubs with other varieties when power10_stubs is "auto".
Instead dup the stub hash table entry.
(plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
tests of power10_stubs.
ld/
* emultempl/ppc64elf.em (power10-stubs): Accept optional "auto" arg.
* ld.texi (power10-stubs): Update.
* testsuite/ld-powerpc/callstub-1.d: Force --power10-stubs.
* testsuite/ld-powerpc/callstub-2.d: Relax branch offset comparison.
* testsuite/ld-powerpc/callstub-4.d: New test.
* testsuite/ld-powerpc/notoc.d: Force --no-power10-stubs.
* testsuite/ld-powerpc/notoc3.d,
* testsuite/ld-powerpc/notoc3.s,
* testsuite/ld-powerpc/notoc3.wf: New test.
* testsuite/ld-powerpc/powerpc.exp: Run new tests.  Pass
--no-power10-stubs for notoc link.

(cherry picked from commit e10a07b32dc1faed25b5bbcbbc47d68e2ff537b9)

5 years agoAutomatic date update in version.in
GDB Administrator [Sun, 19 Jul 2020 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Sat, 18 Jul 2020 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Jul 2020 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Thu, 16 Jul 2020 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agommix bfd: fix bfd_assert for R_MMIX_PUSHJ_STUBBABLE against undef'd symbol
Hans-Peter Nilsson [Wed, 15 Jul 2020 04:22:28 +0000 (06:22 +0200)] 
mmix bfd: fix bfd_assert for R_MMIX_PUSHJ_STUBBABLE against undef'd symbol

Spotted when inspecting gcc testsuite logs, but this already is
covered by the ld-mmix testsuite, it's just that the assert is ignored
since the regexp match is for a substring and not anchored.

With the anchors added but not the bugfix, the ld.log shows that the
asserts cause a non-match as intended:

Executing on host: sh -c {./ld-new   -LX/src/ld/testsuite/ld-mmix  -m elf64mmix -o tmpdir/dump tmpdir/undef-2.o tmpdir/start.o  2>&1}  /dev/null dump.tmp (timeout = 300)
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: tmpdir/undef-2.o:(.text+0x0): undefined reference to `undefd'
failed with: <./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: BFD (GNU Binutils) 2.34.50.20200629 assertion fail X/src/bfd/elf64-mmix.c:2845
./ld-new: tmpdir/undef-2.o:(.text+0x0): undefined reference to `undefd'>, expected: <\A[^\n\r]*undefined reference to `undefd'\Z>
FAIL: ld-mmix/undef-2

Gone with the fix of course, leaving just the intended "undefined
reference" line.

I'm not going to add anchors manually for all the "error:" strings in
the test-suite, not even in the mmix parts.  Sorry, but I'll just do
it for *these* specific undefined-reference tests.

Just a thought: maybe the run_dump_test "error:" string should
*automatically* get anchor marks prepended and appended for a single
line match as in the patch, "\A[^\n\r]*" prepended and \Z appended
unless either anchor mark or \r or \n is present in the regexp?

Committed.

bfd:
* elf64-mmix.c (mmix_elf_relax_section): Improve accounting for
R_MMIX_PUSHJ_STUBBABLE relocs against undefined symbols.

ld/testsuite:
* testsuite/ld-mmix/undef-1.d, testsuite/ld-mmix/undef-1m.d,
testsuite/ld-mmix/undef-2.d, testsuite/ld-mmix/undef-2m.d: Add
start- and end-anchors to error-string to match just a
single-line error-message.

(cherry picked from commit a8a48c756c0da3a49008662e14ae582764ddd0bb)

5 years agox86: Don't display eiz with no scale
H.J. Lu [Wed, 15 Jul 2020 13:49:45 +0000 (06:49 -0700)] 
x86: Don't display eiz with no scale

Change

67 48 8b 1c 25 ef cd ab 89  mov    0x89abcdef(,%eiz,1),%rbx

to

67 48 8b 1c 25 ef cd ab 89  mov    0x89abcdef,%rbx

in AT&T syntax and

67 48 8b 1c 25 ef cd ab 89  mov    rbx,QWORD PTR [eiz*1+0x89abcdef]

to

67 48 8b 1c 25 ef cd ab 89  mov    rbx,QWORD PTR ds:0x89abcdef

in Intel syntax.

gas/

PR gas/26237
* testsuite/gas/i386/evex-no-scale-64.d: Updated.
* testsuite/gas/i386/addr32.d: Likewise.
* testsuite/gas/i386/x86-64-addr32-intel.d: Likewise.
* testsuite/gas/i386/x86-64-addr32.d: Likewise.

opcodes/

PR gas/26237
* i386-dis.c (OP_E_memory): Don't display eiz with no scale
without base nor index registers.

(cherry picked from commit 04c662e2b66bedd050f97adec19afe0fcfce9ea7)

5 years agox86-64: Zero-extend lower 32 bits displacement to 64 bits
H.J. Lu [Tue, 14 Jul 2020 16:57:52 +0000 (09:57 -0700)] 
x86-64: Zero-extend lower 32 bits displacement to 64 bits

Since the addr32 (0x67) prefix zero-extends the lower 32 bits address to
64 bits, change disassembler to zero-extend the lower 32 bits displacement
to 64 bits when there is no base nor index registers.

gas/

PR gas/26237
* testsuite/gas/i386/addr32.s: Add tests for 32-bit wrapped around
address.
* testsuite/gas/i386/x86-64-addr32.s: Likewise.
* testsuite/gas/i386/addr32.d: Updated.
* testsuite/gas/i386/x86-64-addr32-intel.d: Likewise.
* testsuite/gas/i386/x86-64-addr32.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-addr32-intel.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-addr32.d: Likewise.

opcodes/

PR gas/26237
* i386-dis.c (OP_E_memory): Without base nor index registers,
32-bit displacement to 64 bits.

(cherry picked from commit 8e58ef803cf752cbde547a5064540f05470ea714)

5 years agox86: Remove 32-bit sign extension in offset_in_range
H.J. Lu [Mon, 13 Jul 2020 17:18:39 +0000 (10:18 -0700)] 
x86: Remove 32-bit sign extension in offset_in_range

When encoding a 32-bit offset, there is no need to sign-extend it to 64
bits since only the lower 32 bits are used.

PR gas/26237
* config/tc-i386.c (offset_in_range): Remove 32-bit sign
extension.

(cherry picked from commit 7a705315596cf5effe01de8c3ac2535687c5663d)

5 years agoFix the generation of REL relocs for missing build notes.
Nick Clifton [Wed, 15 Jul 2020 11:53:59 +0000 (12:53 +0100)] 
Fix the generation of REL relocs for missing build notes.

* write.c (create_note_reloc): Add desc2_size parameter.  Zero out
the addend field of REL relocations.  Store the full addend into
the note for REL relocations.

5 years agoFix an illegal memory access in the BFD library which can be triggered by an attempt...
Nick Clifton [Wed, 15 Jul 2020 10:15:16 +0000 (11:15 +0100)] 
Fix an illegal memory access in the BFD library which can be triggered by an attempt to parse a corrupt PE format file.

PR26240
* coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in
check for aux entries that overflow the buufer.

5 years agoAutomatic date update in version.in
GDB Administrator [Wed, 15 Jul 2020 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Jul 2020 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

5 years agopowerpc garbage collect test
Alan Modra [Thu, 9 Jul 2020 13:18:10 +0000 (22:48 +0930)] 
powerpc garbage collect test

ld's garbage collection test on powerpc64 catered for old compilers
(pre -mcmodel=medium support), setting options that caused the test to
fail.  Which meant the test wasn't really testing anything.  Get rid
of that old compiler support, and avoid -fPIE fails on ppc32.

* testsuite/ld-gc/gc.exp: Don't set -mminimal-toc for powerpc64,
and remove powerpc64 xfail.  Use -fno-PIE for ppc32.

(cherry picked from commit c560184eb2074570988c498aaae494d0c4b00328)

5 years agopr18841 tests on powerpc64
Alan Modra [Thu, 9 Jul 2020 07:05:27 +0000 (16:35 +0930)] 
pr18841 tests on powerpc64

The PR18841 test does cross-module calls from within an ifunc
resolver, which is nasty, and not supported in general since the
called function may not be relocated.  In this case the called
function (zoo) is just a stub so doesn't need relocating, but on ppc64
the function descriptor for zoo in the executable won't be relocated
at the time the shared library ifunc resolver runs.  That means the
test will fail if your compiler generates PIEs by default.

PR 18841
* testsuite/ld-ifunc/ifunc.exp: Run pr18841 tests non-pie.

(cherry picked from commit 470cd0faa7f433b47944683eee4fc3dad6ef7cdf)