]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
4 years agobinutils: Avoid renaming over existing files
Siddhesh Poyarekar [Mon, 22 Feb 2021 15:15:50 +0000 (20:45 +0530)] 
binutils: Avoid renaming over existing files

Renaming over existing files needs additional care to restore
permissions and ownership, which may not always succeed.
Additionally, other properties of the file such as extended attributes
may be lost, making the operation flaky.

For predictable results, resort to rename() only if the file does not
exist, otherwise copy the file contents into the existing file.  This
ensures that no additional tricks are needed to retain file
properties.

This also allows dropping of the redundant set_times on the tmpfile in
objcopy/strip since now we no longer rename over existing files.

binutils/

* ar.c (write_archive): Adjust call to SMART_RENAME.
* arsup.c (ar_save): Likewise.
* objcopy (strip_main): Don't set times on temporary file and
adjust call to SMART_RENAME.
(copy_main): Likewise.
* rename.c [!S_ISLNK]: Remove definitions.
(try_preserve_permissions): Remove function.
(smart_rename): Replace PRESERVE_DATES argument with
TARGET_STAT.  Use rename system call only if TO does not exist.
* bucomm.h (smart_rename): Adjust declaration.

(cherry picked from commit 3685de750e6a091663a0abe42528cad29e960e35)

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 22 Feb 2021 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 21 Feb 2021 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 20 Feb 2021 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoIBM Z: Implement instruction set extensions
Andreas Krebbel [Mon, 15 Feb 2021 13:20:00 +0000 (14:20 +0100)] 
IBM Z: Implement instruction set extensions

opcodes/

        * s390-mkopc.c (main): Accept arch14 as cpu string.
        * s390-opc.txt: Add new arch14 instructions.

include/

        * opcode/s390.h (enum s390_opcode_cpu_val): Add
        S390_OPCODE_ARCH14.

gas/

        * config/tc-s390.c (s390_parse_cpu): New entry for arch14.
        * doc/c-s390.texi: Document arch14 march option.
        * testsuite/gas/s390/s390.exp: Run the arch14 related tests.
        * testsuite/gas/s390/zarch-arch14.d: New test.
        * testsuite/gas/s390/zarch-arch14.s: New test.

(cherry picked from commit ba2b480f1037082d27da1afdfe0793c8aac9b1bd)

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 19 Feb 2021 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 18 Feb 2021 00:01:11 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 17 Feb 2021 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 16 Feb 2021 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 15 Feb 2021 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 14 Feb 2021 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 13 Feb 2021 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 12 Feb 2021 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 11 Feb 2021 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 10 Feb 2021 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoPR27382, build failure if fileno() is a macro
Alan Modra [Tue, 9 Feb 2021 03:02:36 +0000 (13:32 +1030)] 
PR27382, build failure if fileno() is a macro

PR 27382
* objcopy.c (copy_file): Use bfd_stat.

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 9 Feb 2021 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 8 Feb 2021 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agold: Remove x86 ISA level run-time tests
H.J. Lu [Sun, 7 Feb 2021 21:11:16 +0000 (13:11 -0800)] 
ld: Remove x86 ISA level run-time tests

Remove x86 ISA level run-time tests since with glibc 2.33, they will fail
to run on machines with lesser x86 ISA level:

tmpdir/property-5-pie: CPU ISA level is lower than required

PR ld/27358
* testsuite/ld-i386/i386.exp: Remove property 3/4/5 run-time
tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.

(cherry picked from commit 38a143aa8c633225e000fd006a5a171f0b6c80ee)

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 7 Feb 2021 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoReset development back to true
Nick Clifton [Sat, 6 Feb 2021 09:21:36 +0000 (09:21 +0000)] 
Reset development back to true

4 years agoThis is 2.36.1 release binutils-2_36_1
Nick Clifton [Sat, 6 Feb 2021 09:12:37 +0000 (09:12 +0000)] 
This is 2.36.1 release

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 6 Feb 2021 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoRevert "binutils: Make smart_rename safe too"
Nick Clifton [Fri, 5 Feb 2021 14:14:01 +0000 (14:14 +0000)] 
Revert "binutils: Make smart_rename safe too"

This reverts commit 014cc7f849e8209623fc99264814bce7b3b6faf2.
Given the problems associated with this patch and the others intended to fix the smart_rename CVE, the decision has been taken to$

4 years agoRevert "Fix a build problem when using FreeBSD 12."
Nick Clifton [Fri, 5 Feb 2021 14:12:24 +0000 (14:12 +0000)] 
Revert "Fix a build problem when using FreeBSD 12."

This reverts commit b143e2d506bee1020752597f979d5af174edc36d.
Given the problems associated with this patch and the others intended to fix the smart_rename CVE, the decision has been taken to$

4 years agoRevert "pr27270 and pr27284, ar segfaults and wrong file mode"
Nick Clifton [Fri, 5 Feb 2021 14:10:21 +0000 (14:10 +0000)] 
Revert "pr27270 and pr27284, ar segfaults and wrong file mode"

This reverts commit 95b91a043aeaeb546d2fea556d84a2de1e917770.
Given the problems associated with this patch and the others intended to fix the smart_rename CVE, the decision has been taken to$

4 years agoRevert "PR27345, binutils/arsup.c: lstat() not available on all targets"
Nick Clifton [Fri, 5 Feb 2021 14:08:16 +0000 (14:08 +0000)] 
Revert "PR27345, binutils/arsup.c: lstat() not available on all targets"

This reverts commit c0034ac596db89dfb5fa007a63488ad7af555fe9.
Given the problems associated with this patch and the others intended to fix the smart_rename CVE, the decision has been taken to revert the patches for the 2.36.1 point release.

4 years agoPR27345, binutils/arsup.c: lstat() not available on all targets
Alan Modra [Fri, 5 Feb 2021 02:29:16 +0000 (12:59 +1030)] 
PR27345, binutils/arsup.c: lstat() not available on all targets

We can just use stat here, the same as is done in ar.c:open_inarch.

PR 27345
* arsup.c (ar_save): Use stat rather than lstat.

(cherry picked from commit c180f095f32ca62f138da9bc7fb96cac0365fb5d)

4 years agoRISC-V: Removed the v0.93 bitmanip ZBA/ZBB/ZBC instructions.
Nelson Chu [Thu, 4 Feb 2021 08:15:03 +0000 (16:15 +0800)] 
RISC-V: Removed the v0.93 bitmanip ZBA/ZBB/ZBC instructions.

bfd/
    * elfxx-riscv.c (riscv_parse_prefixed_ext): Removed zb*.
gas/
    * config/tc-riscv.c (riscv_multi_subset_supports): Removed
    INSN_CLASS_ZB*.
    * testsuite/gas/riscv/bitmanip-insns-32.d: Removed.
    * testsuite/gas/riscv/bitmanip-insns-64.d: Removed.
    * testsuite/gas/riscv/bitmanip-insns.s: Removed.
include/
    * opcode/riscv-opc.h: Removed macros for zb* extensions.
    * opcode/riscv.h (riscv_insn_class): Removed INSN_CLASS_ZB*.
opcodes/
    * riscv-opc.c (MASK_RVB_IMM): Removed.
    (riscv_opcodes): Removed zb* instructions.
    (riscv_ext_version_table): Removed versions for zb*.

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

4 years agold: Restore PR ld/15146 tests
H.J. Lu [Thu, 4 Feb 2021 13:11:37 +0000 (05:11 -0800)] 
ld: Restore PR ld/15146 tests

commit 7d409ac001cce916661d345bff01ed589991e762
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Feb 4 13:56:34 2021 +1030

    PR27311, (symbol from plugin): undefined reference, hidden sym

fixed PR ld/15146.  Restore PR ld/15146 tests.

PR ld/15146
* testsuite/ld-plugin/lto.exp: Run PR ld/15146 tests.
* testsuite/ld-plugin/pr15146.d: Restored.
* testsuite/ld-plugin/pr15146a.c: Likewise.
* testsuite/ld-plugin/pr15146b.c: Likewise.
* testsuite/ld-plugin/pr15146c.c: Likewise.
* testsuite/ld-plugin/pr15146d.c: Likewise.

(cherry picked from commit 37707bd8221c2e3f7676de8bee0c42ce3ab38c77)

4 years agoPR27311, (symbol from plugin): undefined reference, hidden sym
Alan Modra [Thu, 4 Feb 2021 03:26:34 +0000 (13:56 +1030)] 
PR27311, (symbol from plugin): undefined reference, hidden sym

bfd/
PR 27311
* elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
libraries for IR references on pass over libraries after LTO
recompilation.
ld/
* testsuite/ld-plugin/pr27311d.c: New test.
* testsuite/ld-plugin/lto.exp: Rename pr27311 to pr27311-1, compile
and link new test as pr27311-2.

(cherry picked from commit 7d409ac001cce916661d345bff01ed589991e762)

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 4 Feb 2021 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agopr27270 and pr27284, ar segfaults and wrong file mode
Alan Modra [Sun, 31 Jan 2021 15:34:41 +0000 (02:04 +1030)] 
pr27270 and pr27284, ar segfaults and wrong file mode

PR 27270
PR 27284
PR 26945
* ar.c: Don't include libbfd.h.
(write_archive): Replace xmalloc+strcpy with xstrdup.  Use
bfd_stat rather than fstat on iostream.  Move stat and fd tests
outside of _WIN32 ifdef.  Delete skip_stat variable.
* arsup.c (temp_name, real_ofd): New static variables.
(ar_open): Use make_tempname and bfd_fdopenw.
(ar_save): Adjust to suit ar_open changes.  Move stat output
of _WIN32 ifdef.
* objcopy.c: Don't include libbfd.h.
(copy_file): Use bfd_stat.

(cherry picked from commit 95b91a043aeaeb546d2fea556d84a2de1e917770)

4 years agoPR27311, ld.bfd (symbol from plugin): undefined reference
Alan Modra [Tue, 2 Feb 2021 04:35:14 +0000 (15:05 +1030)] 
PR27311, ld.bfd (symbol from plugin): undefined reference

A default versioned symbol definition in a shared library is
overridden by an unversioned definition in a regular object file, and
thus should not be reason to make an as-needed library needed.

bfd/
PR 27311
* elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
libraries when H is an indirect symbol after calling
_bfd_elf_add_default_symbol.
ld/
* testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
Link with --as-needed.

* testsuite/ld-plugin/pr27311.d,
* testsuite/ld-plugin/pr27311.ver,
* testsuite/ld-plugin/pr27311a.c,
* testsuite/ld-plugin/pr27311b.c,
* testsuite/ld-plugin/pr27311c.c: New testcase.
* testsuite/ld-plugin/lto.exp: Run it.  Correct PR14918 and
PR12982 entries.

(cherry picked from commit 9918bff7cf2a566aaa2036d2242a61c140652dc7)
(cherry picked from commit 6955136728a68365bbb5e6e1327dff1654b2a0ca)
(cherry picked from commit f01fb44c0621b064996493bb5acd5077646ea84e)

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 3 Feb 2021 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 2 Feb 2021 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 1 Feb 2021 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 31 Jan 2021 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

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

4 years agoPR27259, SHF_LINK_ORDER self-link
Alan Modra [Thu, 28 Jan 2021 00:00:36 +0000 (10:30 +1030)] 
PR27259, SHF_LINK_ORDER self-link

This stops ld from endless looping on SHF_LINK_ORDER sh_link loops.

bfd/
PR 27259
* elflink.c (_bfd_elf_gc_mark_extra_sections): Use linker_mark to
prevent endless looping of linked-to sections.
ld/
PR 27259
* ldelf.c (ldelf_before_place_orphans): Use linker_mark to
prevent endless looping of linked-to sections.

(cherry picked from commit def97fb945a98544938087eff3111e16ce58da6d)

4 years agoPR27271, c6x-uclinux-ld segfaults linking ld-uClibc-1.0.37.so
Alan Modra [Fri, 29 Jan 2021 00:27:48 +0000 (10:57 +1030)] 
PR27271, c6x-uclinux-ld segfaults linking ld-uClibc-1.0.37.so

bfd/
PR 27271
* elflink.c (bfd_elf_link_record_dynamic_symbol): Don't segfault
on symbols defined in absolute or other special sections.
ld/
* testsuite/ld-tic6x/tic6x.exp: Add pr27271 test.

(cherry picked from commit c4566785ac265b3e4b3cde0e43733975c58d9175)

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 29 Jan 2021 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agogold: Skip address size and segment selector for DWARF5
H.J. Lu [Thu, 28 Jan 2021 12:21:15 +0000 (04:21 -0800)] 
gold: Skip address size and segment selector for DWARF5

The .debug_line secton in DWARF5 has a byte for address size and a byte
for segment selector after DWARF version.  Skip them for DWARF5.

PR gold/27246
* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog):
Skip address size and segment selector for DWARF5.

(cherry picked from commit 0318cca4934fc5d85e83351842985ad2a3475146)

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 Jan 2021 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agold: depend on libctf
Nick Alcock [Tue, 26 Jan 2021 16:05:17 +0000 (16:05 +0000)] 
ld: depend on libctf

Since ld may depend on libctf (if present), and libctf may be relinked
by the installation process, libctf must be installed before ld is,
or the relink may fail if it calls on symbols or symbol versions that do
not exist in any libctf already present on the system.  (If none is
present, the copy in the build tree will be automatically used, but
if one *is* present, it may take precedence and break things.)

(This is a maybe- dependency, so it will work even if libctf is
disabled.)

ChangeLog
2021-01-26  Nick Alcock  <nick.alcock@oracle.com>

* Makefile.def: Add install-libctf dependency to install-ld.
* Makefile.in: Regenerated.

4 years agoUpdate the DWARF sections recognuised by ELF linker scripts.
Nick Clifton [Wed, 27 Jan 2021 09:02:05 +0000 (09:02 +0000)] 
Update the DWARF sections recognuised by ELF linker scripts.

        PR ld/27230
        * scripttempl/DWARF.sc: Add DWARF-5 .debug_* sections.

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 Jan 2021 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoSegmentation fault i386-gen
Alan Modra [Tue, 26 Jan 2021 01:50:23 +0000 (12:20 +1030)] 
Segmentation fault i386-gen

A case of inst->next being uninitialised.

* i386-gen.c (parse_template): Ensure entire template_instance
is initialised.

(cherry picked from commit c3ffb8f340f567949f24c3bab62259f0e593637f)

4 years agopr27228 testcase
Alan Modra [Mon, 25 Jan 2021 04:47:15 +0000 (15:17 +1030)] 
pr27228 testcase

This failed on ft32, hppa, and mips-irix targets.  In the case of ft32
the problem was iterating over an array in reverse and not using the
proper condition, so BFD_RELOC_NONE was not recognised.

bfd/
* elf32-ft32.c (ft32_reloc_type_lookup): Don't miss ft32_reloc_map[0].
gas/
PR 27282
* testsuite/gas/all/none.d: Replace skip with xfail, don't xfail ft32.
* testsuite/gas/elf/pr27228.d: xfail hppa and allow OBJECT match.

(cherry picked from commit 4287950e540900bfefa113f264c7f798b1616ee0)

4 years agoFix thinko in objcopy's memory freeing code.
Frederic Cambus [Tue, 26 Jan 2021 09:55:34 +0000 (09:55 +0000)] 
Fix thinko in objcopy's memory freeing code.

* objcopy.c (copy_main): Fix a double free happening when both
--localize-symbols and --globalize-symbols options are invoked
together.

(cherry picked from commit e37709f0901fe6f2410094151002bab3d123df85)

4 years agonios2: Don't disable relaxation with --gdwarf-N
H.J. Lu [Tue, 26 Jan 2021 16:18:39 +0000 (08:18 -0800)] 
nios2: Don't disable relaxation with --gdwarf-N

GCC 11 passes --gdwarf-5 to assembler to enable DWARF5 debug info.  Don't
disable relaxation when --gdwarf-N is specified.  The assembler generated
debug information will treat the sequence of the relaxed instructions as
a single instruction.

PR gas/27243
* config/tc-nios2.c (md_begin): Don't disable relaxation with
--gdwarf-N.
* testsuite/gas/nios2/relax.d: New file.
* testsuite/gas/nios2/relax.s: Likewise.

(cherry picked from commit 1f583bc2fcb1b5c4125faf8b8e815255b2b21b62)

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 Jan 2021 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 25 Jan 2021 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoDWARF-5: Ignore empty range in DWARF-5 line number tables
H.J. Lu [Sun, 24 Jan 2021 15:00:34 +0000 (07:00 -0800)] 
DWARF-5: Ignore empty range in DWARF-5 line number tables

The DWARF5 spec does indeed explicitly say: "A bounded range entry whose
beginning and ending address offsets are equal (including zero) indicates
an empty range and may be ignored."

Since arange_add already ignores empty ranges, remove the whole check
which is equivalent to the check plus explicit continue.

PR binutils/27231
* dwarf2.c (read_rnglists): Ignore empty range when parsing line
number tables.

(cherry picked from commit 940d0202fd472b09d370fb483bf5a8ae99c9c830)

4 years agogas: Add a testcase for PR gas/27228
H.J. Lu [Sun, 24 Jan 2021 12:14:30 +0000 (04:14 -0800)] 
gas: Add a testcase for PR gas/27228

PR gas/27228
* testsuite/gas/elf/elf.exp: Run pr27228.
* testsuite/gas/elf/pr27228.d: New file.
* testsuite/gas/elf/pr27228.s: Likewise.

(cherry picked from commit eea133e65524218c05bd7a1e93b4fe4241dd8e08)

4 years agoEnable development. Set version to 2.36.0
Nick Clifton [Sun, 24 Jan 2021 11:50:31 +0000 (11:50 +0000)] 
Enable development.  Set version to 2.36.0

4 years ago2.36 release binutils-2_36
Nick Clifton [Sun, 24 Jan 2021 10:49:36 +0000 (10:49 +0000)] 
2.36 release

4 years agoPR27228, .reloc wrong symbol emitted for undefined local symbol
Alan Modra [Sun, 24 Jan 2021 02:09:07 +0000 (12:39 +1030)] 
PR27228, .reloc wrong symbol emitted for undefined local symbol

Local symbols are of course supposed to be defined by their object
file, but in other cases a local symbol is promoted to global by gas
if undefined and referenced.  This patch stops gas wrongly replacing a
local undefined symbol with the undefined section symbol, resulting in
a .reloc undefined local symbol being emitted as global.

PR 27228
* write.c (resolve_reloc_expr_symbols): Don't assume local symbol
is defined.

(cherry picked from commit 68fcee4fa753f6488c9f90610da2f5a5a95d5a1f)

4 years agoDWARF-5: Fix parsing DWARF-5 line number tables
H.J. Lu [Sun, 24 Jan 2021 02:17:37 +0000 (18:17 -0800)] 
DWARF-5: Fix parsing DWARF-5 line number tables

Advance rngs_ptr when parsing DW_RLE_offset_pair, which was missing in

commit c3757b583d2448a5996e83e374fb96ac7938da35
Author: Mark Wielaard <mark@klomp.org>
Date:   Tue Aug 25 15:33:00 2020 +0100

    Fix the linker's handling of DWARF-5 line number tables.

PR binutils/27231
* dwarf2.c (read_rnglists): Advance rngs_ptr after
_bfd_safe_read_leb128 when parsing DW_RLE_offset_pair.

(cherry picked from commit 18454c151f5824564130ba626bd90e9de30444ef)

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 Jan 2021 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 Jan 2021 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 Jan 2021 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoPR27221, 058430b4a1 warnings while assembling the Linux kernel
Alan Modra [Thu, 21 Jan 2021 06:20:02 +0000 (16:50 +1030)] 
PR27221, 058430b4a1 warnings while assembling the Linux kernel

PR 27221
* dwarf2dbg.c (dwarf2_gen_line_info_1): Don't warn about ignored
line number info when gas is generating it.
* testsuite/gas/elf/dwarf2-20.d: Adjust to not expect warnings.
* testsuite/gas/m68hc11/indexed12.d: Likewise.
* testsuite/gas/elf/elf.exp: Don't run warn-2.
* gas/testsuite/gas/elf/warn-2.s: Delete.

(cherry picked from commit be07043ea8ea9b22a8db1ff46b557321a7714e9a)

4 years agoPR27218, memory access violation in dwarf2dbg.c
Alan Modra [Thu, 21 Jan 2021 06:16:20 +0000 (16:46 +1030)] 
PR27218, memory access violation in dwarf2dbg.c

PR 27218
* dwarf2dbg.c (dwarf2_gen_line_info): Correct setting of dwarf_level.
(dwarf2_directive_filename, dwarf2_directive_loc): Likewise, and
error for negative file numbers.

(cherry picked from commit 498ff0328fed7689f7a675d8c9f0f04bed1f1522)

4 years agomips XPASS pr26936
Alan Modra [Wed, 20 Jan 2021 21:06:38 +0000 (07:36 +1030)] 
mips XPASS pr26936

git commit 994b25132814 "Ignore section symbols when matching linkonce
with comdat" cured the reason why this test used to fail on mips.

* testsuite/ld-elf/pr26936.d: No longer xfail mips.

(cherry picked from commit c78eec4424a6322682b3a164d1691135dcf004b3)

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 Jan 2021 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoPowerPC64 synthetic symbols
Alan Modra [Wed, 20 Jan 2021 05:30:58 +0000 (16:00 +1030)] 
PowerPC64 synthetic symbols

If an assembler trims off unused section symbols there may be no
section symbols.  This means that testing for the .opd section symbol
needs to test both the section name and symbol flags.

* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't assume
section symbols are present.

(cherry picked from commit 8bd10d6b16de92570336e6026d466ef90e077e6e)

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 20 Jan 2021 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agolibctf, create: fix ctf_type_add of structs with unnamed members
Nick Alcock [Tue, 19 Jan 2021 12:45:18 +0000 (12:45 +0000)] 
libctf, create: fix ctf_type_add of structs with unnamed members

Our recent commit to support unnamed structure members better ditched
the old ctf_member_iter iterator body in favour of ctf_member_next.
However, these functions treat unnamed structure members differently:
ctf_member_iter just returned whatever the internal representation
contained, while ctf_member_next took care to always return "" rather
than sometimes returning "" and sometimes NULL depending on whether the
dict was dynamic (a product of ctf_create) or not (a product of
ctf_open).  After this commit, ctf_member_iter did the same.

It was always a bug for external callers not to treat a "" return from
these functions as if it were NULL, so only buggy callers could be
affected -- but one of those buggy callers was ctf_add_type, which
assumed that it could just take whatever name was returned from
ctf_member_iter and slam it directly into the internal representation of
a dynamic dict -- which expects NULL for unnamed members, not "".  The
net effect of all of this is that taking a struct containing unnamed
members and ctf_add_type'ing it into a dynamic dict produced a dict
whose unnamed members were inaccessible to ctf_member_info (though if
you wrote that dict out and then ctf_open'ed it, they would magically
reappear again).

Compensate for this by suitably transforming a "" name into NULL in the
internal representation, as should have been done all along.

libctf/ChangeLog
2021-01-19  Nick Alcock  <nick.alcock@oracle.com>

* ctf-create.c (membadd): Transform ""-named members into
NULL-named ones.
* testsuite/libctf-regression/type-add-unnamed-struct*: New test.

(cherry picked from commit 26503e2f5eae6019c8649a3dd204a82705efc740)

4 years agolibctf: lookup_by_name: do not return success for nonexistent pointer types
Nick Alcock [Tue, 19 Jan 2021 12:45:18 +0000 (12:45 +0000)] 
libctf: lookup_by_name: do not return success for nonexistent pointer types

The recent work allowing lookups of pointers in child dicts when the
pointed-to type is in the parent dict broke the case where a pointer
type that does not exist at all is looked up: we mistakenly return the
pointed-to type, which is likely not a pointer at all.  This causes
considerable confusion.

Fixed, with a new testcase.

libctf/ChangeLog
2021-01-19  Nick Alcock  <nick.alcock@oracle.com>

* ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
base type if looking up a nonexistent pointer type.
* testsuite/libctf-regression/pptrtab*: Test it.

(cherry picked from commit e05a3e5a491a8ef2079eef558bbe8e9feb0b3c03)

4 years ago[GOLD] powerpc assertion failure
Alan Modra [Tue, 19 Jan 2021 02:49:18 +0000 (13:19 +1030)] 
[GOLD] powerpc assertion failure

A testcase with only ifuncs can result in no plt section (ifunc plt
entries might instead be in iplt), which means we can get to this code
without a static link.

PR 27203
* powerpc.cc (do_plt_fde_location): Remove doing_static_link
assertion.

(cherry picked from commit a75a6a416477915b7d236537c9170ced3064df11)

4 years agold: Just xfail riscv little endian targets for compressed1d.d test.
Nelson Chu [Fri, 8 Jan 2021 12:04:13 +0000 (04:04 -0800)] 
ld: Just xfail riscv little endian targets for compressed1d.d test.

The sizes of compressed and uncompressed .debug_aranges are the same
for the riscv big endian targets, but different for the little endian
targets.  The compress rule is fine and isn't broken by riscv, just the
original compressed1d.d fails by accident.  Ideally, we should fill the
R_RISCV_ADD/SUB relocations when disabling relaxations in the assembler.
But before that, Jim already had written an alternative test compressed1d-alt
to relpace compressed1d.d for riscv, so we can only xfail the riscv little
endian targets in the short-term.

ld/
    * testsuite/ld-elf/elf.exp (riscv_little_endian): Added.  Return true
    if target is riscv little endian.  Otherwise, return false.
    * testsuite/ld-elf/compressed1d.d: Only xfail the riscv little endian
    targets by [riscv_little_endian].

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 Jan 2021 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

4 years agoas: Automatically enable DWARF5 support
H.J. Lu [Mon, 18 Jan 2021 14:25:05 +0000 (06:25 -0800)] 
as: Automatically enable DWARF5 support

Currently

$ as -o x.o x.s

fails when x.s contains DWARF5 ".file 0" or ".loc 0" directives.  Update
assembler to automatically enable DWARF5 support so that

$ gcc -S -g -c x.c
$ gcc -c x.s

works.

PR gas/27195
* dwarf2dbg.c (dwarf2_gen_line_info): Set dwarf_level to 5 if
needed.
(dwarf2_directive_filename): Likewise.
(dwarf2_directive_loc): Likewise.
* testsuite/gas/elf/dwarf-5-file0.d: Pass --gdwarf-3.
* testsuite/gas/lns/lns-diag-1.l: Remove the
"Error: file number less than one" errors.

(cherry picked from commit 705989f19adf20dd70c50237ec61cd708f2b0939)

4 years agogold: Remove the circular IFUNC dependency in ifuncmain6pie
H.J. Lu [Mon, 18 Jan 2021 00:43:45 +0000 (16:43 -0800)] 
gold: Remove the circular IFUNC dependency in ifuncmain6pie

On Fedora 33 x86-64 with glibc 2.32-3, ifuncmain6pie failed with:

./ifuncmain6pie: IFUNC symbol 'foo' referenced in './ifuncmod6.so' is defined in the executable and creates an unsatisfiable circular dependency.
FAIL ifuncmain6pie (exit status: 127)

Remove non-JUMP_SLOT relocations against foo in ifuncmod6.so, which
trigger the circular IFUNC dependency.

* testsuite/ifuncmain6pie.c: Remove non-JUMP_SLOT relocations
against foo in ifuncmod6.so.
* testsuite/ifuncmod6.c: Likewise.

(cherry picked from commit 25294ff049728a081c703b68f848d2cc04eef483)

4 years agold/elf: Ignore section symbols when matching linkonce with comdat
H.J. Lu [Mon, 18 Jan 2021 04:01:16 +0000 (20:01 -0800)] 
ld/elf: Ignore section symbols when matching linkonce with comdat

When deciding if a single member comdat group section in file FOO should
be discarded by a linkonce section in file BAR, we check if 2 sections
define the same set of local and global symbols.  When only one of the
files doesn't contain the unused section symbols in the symbol table,
such as object files generated by clang or GNU assembler with

commit d1bcae833b32f1408485ce69f844dcd7ded093a8
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jan 7 06:42:00 2021 -0800

    ELF: Don't generate unused section symbols

the check will fail since one file has the extra unused section symbols.
We should ignore both undefined and section symbols in the symbol table
when making such a decision.

bfd/

PR ld/27193
* elflink.c (elf_create_symbuf): Also ignore section symbols.

ld/

PR ld/27193
* testsuite/ld-i386/i386.exp: Run PR ld/27193 test.
* testsuite/ld-i386/pr27193.dd: New file.
* testsuite/ld-i386/pr27193a.o.bz2: Likewise.
* testsuite/ld-i386/pr27193b.s: Likewise.

(cherry picked from commit 994b25132814f4c2be93ce53a616a74139c4cf3c)

4 years agold/elf/x86: Don't compare IFUNC address in the shared object
H.J. Lu [Sat, 16 Jan 2021 15:00:09 +0000 (07:00 -0800)] 
ld/elf/x86: Don't compare IFUNC address in the shared object

On x86, glibc 2.33 starts to issue a fatal error message when calling
IFUNC function defined in the unrelocated executable from a shared
library.

1. Update x86 ELF linker to always convert IFUNC function defined in
position-dependent executable (PDE) to the normal function.  GOT in PDE
will be updated by R_*_IRELATIVE at run-time.
2. Update PR ld/23169 tests not to compare function address of external
IFUNC function in the shared object to avoid calling the IFUNC function
defined in the unrelocated executable.
3. Remove pr23169e tests which call the IFUNC function defined in the
unrelocated position-independent executable from a shared library.

bfd/

PR ld/23169
* elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): Don't
check pointer_equality_needed.

ld/

PR ld/23169
* testsuite/ld-ifunc/ifunc.exp: Replace pr23169c.rd with
pr23169a.rd for pr23169c and pr23169f.  Remove pr23169e tests.
* testsuite/ld-ifunc/pr23169a.c (foo): Don't compare function
address.

(cherry picked from commit 75a933f39918ce4f4b9481234992895e022787ee)

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 18 Jan 2021 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sun, 17 Jan 2021 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Sat, 16 Jan 2021 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Fri, 15 Jan 2021 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agobfin: Skip non SEC_ALLOC section for R_BFIN_FUNCDESC
H.J. Lu [Thu, 14 Jan 2021 13:23:58 +0000 (05:23 -0800)] 
bfin: Skip non SEC_ALLOC section for R_BFIN_FUNCDESC

Linker should never generate dynamic relocations for relocations in
non-SEC_ALLOC section which has no impact on run-time behavior.  Such
relocations should be resolved to 0.

PR ld/26688
* elf32-bfin.c (bfinfdpic_relocate_section): Skip non SEC_ALLOC
section for R_BFIN_FUNCDESC.

(cherry picked from commit 8ca9c7eb6773dd3cc9c536787b3489d36356ccf7)

4 years agoUpdated translations for some subdirectories
Nick Clifton [Thu, 14 Jan 2021 12:55:06 +0000 (12:55 +0000)] 
Updated translations for some subdirectories

4 years agoFix an illegal memory access parsing a win32pstatus note with a type of 0.
Nick Clifton [Thu, 14 Jan 2021 09:16:58 +0000 (09:16 +0000)] 
Fix an illegal memory access parsing a win32pstatus note with a type of 0.

* elf.c (elfcore_grok_win32pstatus): Check for a note type of 0.

4 years agoAutomatic date update in version.in
GDB Administrator [Thu, 14 Jan 2021 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoAutomatic date update in version.in
GDB Administrator [Wed, 13 Jan 2021 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoelf/x86-64: Adjust R_AMD64_DIR64/R_AMD64_DIR32 for PE/x86-64 inputs
H.J. Lu [Tue, 12 Jan 2021 13:10:58 +0000 (05:10 -0800)] 
elf/x86-64: Adjust R_AMD64_DIR64/R_AMD64_DIR32 for PE/x86-64 inputs

Subtract the value of the section contents for R_AMD64_DIR64 and
R_AMD64_DIR32 relocations when generating ELF output from PE/x86-64
inputs.

bfd/

PR ld/27171
* reloc.c (bfd_perform_relocation): Adjust R_AMD64_DIR64 and
R_AMD64_DIR32 relocations for PE/x86-64 inputs.

ld/

PR ld/27171
* testsuite/ld-x86-64/pe-x86-64-5.obj.bz2: New file.
* testsuite/ld-x86-64/pe-x86-64-5.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-5.rd: Likewise.
* testsuite/ld-x86-64/pe-x86-64.exp: Run PR ld/27171 test.

(cherry picked from commit c2e9a4a3ed1efcbdec68372e7e889470870d6d48)

4 years agoUpdated translations for some subdirectories
Nick Clifton [Tue, 12 Jan 2021 13:18:16 +0000 (13:18 +0000)] 
Updated translations for some subdirectories

4 years agoAutomatic date update in version.in
GDB Administrator [Tue, 12 Jan 2021 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agoaarch64: Remove support for CSRE
Kyrylo Tkachov [Tue, 5 Jan 2021 17:39:04 +0000 (17:39 +0000)] 
aarch64: Remove support for CSRE

This patch removes support for the CSRE extension from aarch64
gas/objdump.
CSRE (FEAT_CSRE) is part of the Future Architecture Technologies program
and at this time Arm is withdrawing this particular feature.

The patch removes the system registers and the CSR PDEC instruction.

gas/ChangeLog
* NEWS: Remove CSRE.
* config/tc-aarch64.c (parse_csr_operand): Delete.
(parse_operands): Delete handling of AARCH64_OPND_CSRE_CSR.
(aarch64_features): Remove csre.
* doc/c-aarch64.texi: Remove CSRE.
* testsuite/gas/aarch64/csre.d: Delete.
* testsuite/gas/aarch64/csre-invalid.s: Likewise.
* testsuite/gas/aarch64/csre-invalid.d: Likewise.
* testsuite/gas/aarch64/csre_csr.s: Likewise.
* testsuite/gas/aarch64/csre_csr.d: Likewise.
* testsuite/gas/aarch64/csre_csr-invalid.s: Likewise.
* testsuite/gas/aarch64/csre_csr-invalid.l: Likewise.
* testsuite/gas/aarch64/csre_csr-invalid.d: Likewise.

include/ChangeLog

* opcode/aarch64.h (AARCH64_FEATURE_CSRE): Delete.
(aarch64_opnd): Delete AARCH64_OPND_CSRE_CSR.

opcodes/ChangeLog

* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Likewise.
* aarch64-opc-2.c: Likewise.
* aarch64-opc.c (aarch64_print_operand): Delete handling of
AARCH64_OPND_CSRE_CSR.
* aarch64-tbl.h (aarch64_feature_csre): Delete.
(CSRE): Likewise.
(_CSRE_INSN): Likewise.
(aarch64_opcode_table): Delete csr.

4 years agoAdd support for more MIPS variants to the linker command line.
Matt Jenkins [Mon, 11 Jan 2021 14:33:03 +0000 (14:33 +0000)] 
Add support for more MIPS variants to the linker command line.

        PR ld/27167
        * ldmain.c (get_emulation): Add mipsmips32r3, mips32r5, mips64r3
        and mips64r5 to list of known mips targets.

4 years agoUpdated translations for multiple subdirectories
Nick Clifton [Mon, 11 Jan 2021 12:55:11 +0000 (12:55 +0000)] 
Updated translations for multiple subdirectories

4 years agoAutomatic date update in version.in
GDB Administrator [Mon, 11 Jan 2021 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

4 years agold/x86-64: Properly Handle -z lam-u48/lam-u57
H.J. Lu [Sat, 9 Jan 2021 14:11:06 +0000 (06:11 -0800)] 
ld/x86-64: Properly Handle -z lam-u48/lam-u57

Properly merge GNU properties for LAM_U48 and LAM_U57.

bfd/

PR ld/27166
* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle
-z lam-u48 and -z lam-u57.

ld/

PR ld/27166
* testsuite/ld-x86-64/lam-u48.rd: New file.
* testsuite/ld-x86-64/lam-u57.rd: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Add PR ld/27166 tests.

(cherry picked from commit 0a94990bf64a82bdf73960fec1b47fef7c6a6ced)

4 years agoChange version number to 2.35.90 and regenerate configure and pot files
Nick Clifton [Sat, 9 Jan 2021 11:23:59 +0000 (11:23 +0000)] 
Change version number to 2.35.90 and regenerate configure and pot files

4 years agoAdd Changelog entries and NEWS entries for 2.36 branch
Nick Clifton [Sat, 9 Jan 2021 10:40:28 +0000 (10:40 +0000)] 
Add Changelog entries and NEWS entries for 2.36 branch

4 years agosim: common: add missing stdlib.h for abort()
Mike Frysinger [Sat, 9 Jan 2021 07:43:54 +0000 (02:43 -0500)] 
sim: common: add missing stdlib.h for abort()

4 years agold/x86-64: Also set LAM_U57 when setting LAM_U48
H.J. Lu [Sat, 9 Jan 2021 05:51:38 +0000 (21:51 -0800)] 
ld/x86-64: Also set LAM_U57 when setting LAM_U48

Since LAM_U48 implies LAM_U57, also set LAM_U57 when setting LAM_U48.

bfd/

* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Also set
LAM_U57 when setting LAM_U48.

ld/

* ld-x86-64/property-x86-lam-u48-4.d: Updated.
* ld-x86-64/property-x86-lam-u48-5.d: Likewise.

4 years agoelf: Verify section size for mixed ordered/unordered inputs
H.J. Lu [Sat, 9 Jan 2021 05:38:39 +0000 (21:38 -0800)] 
elf: Verify section size for mixed ordered/unordered inputs

When fixing up SHF_LINK_ORDER, issue a fatal error if the output section
size is increased.  Otherwise, bfd_set_section_contents will fail later
when attempting to write contents past the end of the output section.

PR ld/26256
PR ld/27160
* elflink.c (elf_fixup_link_order): Verify that fixing up
SHF_LINK_ORDER doesn't increase the output section size.