Commit Graph

104605 Commits

Author SHA1 Message Date
GDB Administrator
17124df60e Automatic date update in version.in 2021-02-13 00:00:34 +00:00
GDB Administrator
c668066dad Automatic date update in version.in 2021-02-12 00:00:50 +00:00
GDB Administrator
a26fdfa101 Automatic date update in version.in 2021-02-11 00:00:38 +00:00
GDB Administrator
9004a5433b Automatic date update in version.in 2021-02-10 00:00:52 +00:00
Alan Modra
7651a4871c PR27382, build failure if fileno() is a macro
PR 27382
	* objcopy.c (copy_file): Use bfd_stat.
2021-02-09 13:37:59 +10:30
GDB Administrator
179cd8fe06 Automatic date update in version.in 2021-02-09 00:00:47 +00:00
GDB Administrator
ad052fe2c4 Automatic date update in version.in 2021-02-08 00:00:46 +00:00
H.J. Lu
43f6058fb2 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 38a143aa8c)
2021-02-07 14:36:38 -08:00
GDB Administrator
bc7e7ec113 Automatic date update in version.in 2021-02-07 00:00:32 +00:00
Nick Clifton
d4dfaba218 Reset development back to true 2021-02-06 09:21:36 +00:00
Nick Clifton
f35674005e This is 2.36.1 release 2021-02-06 09:12:37 +00:00
GDB Administrator
035f70706f Automatic date update in version.in 2021-02-06 00:00:35 +00:00
Nick Clifton
355e5f2ffb Revert "binutils: Make smart_rename safe too"
This reverts commit 014cc7f849.
Given the problems associated with this patch and the others intended to fix the smart_rename CVE, the decision has been taken to$
2021-02-05 14:14:01 +00:00
Nick Clifton
a708e76442 Revert "Fix a build problem when using FreeBSD 12."
This reverts commit b143e2d506.
Given the problems associated with this patch and the others intended to fix the smart_rename CVE, the decision has been taken to$
2021-02-05 14:12:24 +00:00
Nick Clifton
97c8a8cc3f Revert "pr27270 and pr27284, ar segfaults and wrong file mode"
This reverts commit 95b91a043a.
Given the problems associated with this patch and the others intended to fix the smart_rename CVE, the decision has been taken to$
2021-02-05 14:10:21 +00:00
Nick Clifton
86cb5ea563 Revert "PR27345, binutils/arsup.c: lstat() not available on all targets"
This reverts commit c0034ac596.
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.
2021-02-05 14:08:16 +00:00
Alan Modra
c0034ac596 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 c180f095f3)
2021-02-05 15:15:14 +10:30
Nelson Chu
faca03e59f 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*.
2021-02-05 09:26:24 +08:00
GDB Administrator
d49885ad9f Automatic date update in version.in 2021-02-05 00:00:38 +00:00
H.J. Lu
3592ada38d ld: Restore PR ld/15146 tests
commit 7d409ac001
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 37707bd822)
2021-02-04 05:18:40 -08:00
Alan Modra
b71c7a5814 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 7d409ac001)
2021-02-04 16:51:31 +10:30
GDB Administrator
401fafe192 Automatic date update in version.in 2021-02-04 00:00:35 +00:00
Alan Modra
6184480d7c 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 95b91a043a)
2021-02-03 18:40:40 +10:30
Alan Modra
d2ea9f3a70 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 9918bff7cf)
(cherry picked from commit 6955136728)
(cherry picked from commit f01fb44c06)
2021-02-03 18:40:39 +10:30
GDB Administrator
ee6dd62454 Automatic date update in version.in 2021-02-03 00:00:28 +00:00
GDB Administrator
86de3e9d08 Automatic date update in version.in 2021-02-02 00:00:36 +00:00
GDB Administrator
9f9f839842 Automatic date update in version.in 2021-02-01 00:00:41 +00:00
GDB Administrator
5b814b6e4c Automatic date update in version.in 2021-01-31 00:00:52 +00:00
GDB Administrator
5eae73d750 Automatic date update in version.in 2021-01-30 00:00:30 +00:00
Alan Modra
fe0e833171 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 def97fb945)
2021-01-30 09:07:15 +10:30
Alan Modra
00e280d52a 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 c4566785ac)
2021-01-29 11:51:01 +10:30
GDB Administrator
6ff2462fbf Automatic date update in version.in 2021-01-29 00:00:30 +00:00
H.J. Lu
69caaa81ae 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 0318cca493)
2021-01-28 04:30:02 -08:00
GDB Administrator
5e7a8f40bd Automatic date update in version.in 2021-01-28 00:00:36 +00:00
Nick Alcock
e9013bbd33 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.
2021-01-27 11:05:32 +00:00
Nick Clifton
185390e3ca Update the DWARF sections recognuised by ELF linker scripts.
PR ld/27230
        * scripttempl/DWARF.sc: Add DWARF-5 .debug_* sections.
2021-01-27 09:02:05 +00:00
GDB Administrator
0dd1ac834b Automatic date update in version.in 2021-01-27 00:00:35 +00:00
Alan Modra
510753f848 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 c3ffb8f340)
2021-01-27 08:44:12 +10:30
Alan Modra
8a04178688 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 4287950e54)
2021-01-27 08:41:44 +10:30
Frederic Cambus
3fb37e4554 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 e37709f090)
2021-01-27 08:40:29 +10:30
H.J. Lu
0db21b8a2b 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 1f583bc2fc)
2021-01-26 08:47:02 -08:00
GDB Administrator
fa15c4160a Automatic date update in version.in 2021-01-26 00:00:35 +00:00
GDB Administrator
d1cdec5b03 Automatic date update in version.in 2021-01-25 00:00:37 +00:00
H.J. Lu
5876ea37df 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 940d0202fd)
2021-01-24 07:04:49 -08:00
H.J. Lu
8b236dfbac 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 eea133e655)
2021-01-24 04:20:11 -08:00
Nick Clifton
acda002755 Enable development. Set version to 2.36.0 2021-01-24 11:50:31 +00:00
Nick Clifton
9288e0fae6 2.36 release 2021-01-24 10:49:36 +00:00
Alan Modra
1aaad1d55d 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 68fcee4fa7)
2021-01-24 16:19:53 +10:30
H.J. Lu
74c1e3df55 DWARF-5: Fix parsing DWARF-5 line number tables
Advance rngs_ptr when parsing DW_RLE_offset_pair, which was missing in

commit c3757b583d
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 18454c151f)
2021-01-23 18:19:31 -08:00
GDB Administrator
b98520957b Automatic date update in version.in 2021-01-24 00:00:31 +00:00