]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 6 Mar 2022 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 5 Mar 2022 00:01:12 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 4 Mar 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 3 Mar 2022 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 2 Mar 2022 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoRevert "Check thin archive element file size against archive header"
Alan Modra [Tue, 1 Mar 2022 11:24:34 +0000 (21:54 +1030)] 
Revert "Check thin archive element file size against archive header"

This reverts commit 48e3e6aec8a4f37d00ea6c0da3ab45e76490e3db.

PR 28929
* archive.c (_bfd_get_elt_at_filepos): Don't check thin archive
element file size.

(cherry picked from commit 581c5ba435538c23fe63d6884ff885b7ef333568)

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 1 Mar 2022 00:01:56 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 28 Feb 2022 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 27 Feb 2022 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 26 Feb 2022 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 25 Feb 2022 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 24 Feb 2022 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agobinutils 2.38 vs. ppc32 linux kernel
Alan Modra [Mon, 21 Feb 2022 00:28:57 +0000 (10:58 +1030)] 
binutils 2.38 vs. ppc32 linux kernel

Commit b25f942e18d6 made .machine more strict.  Weaken it again.

* config/tc-ppc.c (ppc_machine): Treat an early .machine specially,
keeping sticky options to work around gcc bugs.

(cherry picked from commit cebc89b9328eab994f6b0314c263f94e7949a553)

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 23 Feb 2022 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 22 Feb 2022 00:01:12 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 21 Feb 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 20 Feb 2022 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 19 Feb 2022 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 18 Feb 2022 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoUpdated Serbian translations for the bfd, gold, ld and opcodes directories
Nick Clifton [Thu, 17 Feb 2022 15:17:48 +0000 (15:17 +0000)] 
Updated Serbian translations for the bfd, gold, ld and opcodes directories

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 17 Feb 2022 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agold: Keep indirect symbol from IR if referenced from shared object
H.J. Lu [Fri, 11 Feb 2022 23:13:19 +0000 (15:13 -0800)] 
ld: Keep indirect symbol from IR if referenced from shared object

Don't change indirect symbol defined in IR to undefined if it is
referenced from shared object.

bfd/

PR ld/28879
* elflink.c (_bfd_elf_merge_symbol): Don't change indirect
symbol defined in IR to undefined if it is referenced from
shared object.

ld/

PR ld/28879
* testsuite/ld-plugin/lto.exp: Run PR ld/28879 tests.
* testsuite/ld-plugin/pr28879a.cc: New file.
* testsuite/ld-plugin/pr28879b.cc: Likewise.

(cherry picked from commit 20ea3acc727f3be6322dfbd881e506873535231d)

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 16 Feb 2022 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoi386: Update I386_NEED_DYNAMIC_RELOC_TYPE_P for DT_TEXTREL
H.J. Lu [Tue, 15 Feb 2022 23:03:02 +0000 (15:03 -0800)] 
i386: Update I386_NEED_DYNAMIC_RELOC_TYPE_P for DT_TEXTREL

Update I386_NEED_DYNAMIC_RELOC_TYPE_P to allow R_386_TLS_IE for relocation
in read-only section.

bfd/

PR ld/28894
* elfxx-x86.h (I386_NEED_DYNAMIC_RELOC_TYPE_P): Allow
R_386_TLS_IE.

ld/
PR ld/28894
* testsuite/ld-i386/i386.exp: Run pr28894.
* testsuite/ld-i386/pr28894.d: New file.
* testsuite/ld-i386/pr28894.s: Likewise.

(cherry picked from commit 3319ba7a8d6a42ba071d691789bc184632399331)

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 15 Feb 2022 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoPR28882, build failure with gcc-4.2 due to use of 0b literals
Alan Modra [Sat, 12 Feb 2022 23:26:51 +0000 (09:56 +1030)] 
PR28882, build failure with gcc-4.2 due to use of 0b literals

PR 28882
* elf/loongarch.h: Replace binary literals with hex.

(cherry picked from commit ccbaaa36174c2c3184344ee0e6db648491149a33)

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 14 Feb 2022 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 13 Feb 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 12 Feb 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agox86: Disallow invalid relocation against protected symbol
H.J. Lu [Wed, 9 Feb 2022 23:51:22 +0000 (15:51 -0800)] 
x86: Disallow invalid relocation against protected symbol

I am checking this into master and will backport it to 2.38 branch.

H.J
----
On x86, GCC 12 supports -mno-direct-extern-access to enable canonical
reference to protected function and disable copy relocation.  With
-mno-direct-extern-access, the canonical protected function symbols must
be accessed via canonical reference and the protected data symbols in
shared libraries are non-copyable. Under glibc 2.35, non-canonical
reference to the canonical protected function will get the run-time error:

./y: internal_f: ./libfoo.so: non-canonical reference to canonical protected function

and copy relocations against the non-copyable protected symbols will get
the run-time error:

./x: internal_i: ./libfoo.so: copy relocation against non-copyable protected symbol

Update x86 linker to disallow non-canonical reference to the canonical
protected function:

ld: plt.o: non-canonical reference to canonical protected function `internal_f' in libfoo.so
ld: failed to set dynamic section sizes: bad value

and copy relocation against the non-copyable protected symbol:

ld: main.o: copy relocation against non-copyable protected symbol `internal_i' in libfoo.so

at link-time.

bfd/

PR ld/28875
* elf-properties.c (_bfd_elf_parse_gnu_properties): Don't skip
shared libraries for GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
* elf32-i386.c (elf_i386_scan_relocs): Disallow non-canonical
reference to canonical protected function.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't allow copy
relocation against non-copyable protected symbol.

ld/

PR ld/28875
* testsuite/ld-i386/i386.exp: Check non-canonical reference to
canonical protected function and check copy relocation against
non-copyable protected symbol.
* testsuite/ld-i386/pr21997-1.err: New file.
* testsuite/ld-i386/pr28875.err: Likewise.
* testsuite/ld-i386/pr28875a.c: Likewise.
* testsuite/ld-i386/pr28875b.c: Likewise.
* testsuite/ld-x86-64/pr21997-1a.err: Updated.
* testsuite/ld-x86-64/pr21997-1b.err: Likewise.
* testsuite/ld-x86-64/pr28875-data.err: New file.
* testsuite/ld-x86-64/pr28875-func.err: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Check non-canonical reference
to canonical protected function and check copy relocation against
non-copyable protected symbol.

(cherry picked from commit ebb191adac4ab45498dec0bfaac62f0a33537ba4)

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 11 Feb 2022 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 10 Feb 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoRe-enable development on the 2.38 branch
Nick Clifton [Wed, 9 Feb 2022 13:35:22 +0000 (13:35 +0000)] 
Re-enable development on the 2.38 branch

3 years agoThis is the 2.38 GNU Binutils release binutils-2_38
Nick Clifton [Wed, 9 Feb 2022 12:01:02 +0000 (12:01 +0000)] 
This is the 2.38 GNU Binutils release

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 9 Feb 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoRISC-V: Stop reporting warnings for mismatched extension versions
Palmer Dabbelt [Mon, 7 Feb 2022 20:14:30 +0000 (12:14 -0800)] 
RISC-V: Stop reporting warnings for mismatched extension versions

The extension version checking logic is really just too complicated to
encode into the linker, trying to do so causes more harm than good.
This removes the checks and the associated tests, leaving the logic to
keep the largest version of each extension linked into the target.

bfd/

* elfnn-riscv.c (riscv_version_mismatch): Rename to
riscv_update_subset_version, and stop reporting warnings on
version mismatches.
(riscv_merge_std_ext): Adjust calls to riscv_version_mismatch.
(riscv_merge_multi_letter_ext): Likewise.

ld/
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Remove
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01a.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01b.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02a.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02b.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02c.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02d.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-user-ext-01.d: New test.
* testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p0.s:
Likewise.
* testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p1.s:
Likewise.
* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Remove obselete
attr-merge-arch-failed-{01,02}, replace with
attr-merge-user-ext-01.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
3 years agoi386: Allow GOT32 relocations against ABS symbols
H.J. Lu [Mon, 7 Feb 2022 23:22:19 +0000 (15:22 -0800)] 
i386: Allow GOT32 relocations against ABS symbols

GOT32 relocations are allowed since absolute value + addend is stored in
the GOT slot.

Tested on glibc 2.35 build with GCC 11.2 and -Os.

bfd/

PR ld/28870
* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
relocations.

ld/

PR ld/28870
* testsuite/ld-i386/i386.exp: Run pr28870.
* testsuite/ld-i386/pr28870.d: New file.
* testsuite/ld-i386/pr28870.s: Likewise.

(cherry picked from commit 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7)

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 8 Feb 2022 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoRevert "elf: Remove the 1-page gap before the RELRO segment"
Alan Modra [Sun, 6 Feb 2022 23:12:03 +0000 (09:42 +1030)] 
Revert "elf: Remove the 1-page gap before the RELRO segment"

This reverts commit 2f83249c13d86065b4c7cdb198ea871017b4bba1.

PR ld/28743
* ldlang.c (lang_size_relro_segment_1): Revert 2022-01-10 changes.
* testsuite/ld-i386/pr20830.d: Likewise.
* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
* testsuite/ld-x86-64/pr14207.d: Likewise.
* testsuite/ld-x86-64/pr18176.d: Likewise.
* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
* testsuite/ld-x86-64/pr20830a.d: Likewise.
* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
* testsuite/ld-x86-64/pr20830b.d: Likewise.
* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
* testsuite/ld-x86-64/pr21038a.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.

3 years agoRevert "ld: Rewrite lang_size_relro_segment_1"
Alan Modra [Sun, 6 Feb 2022 23:07:51 +0000 (09:37 +1030)] 
Revert "ld: Rewrite lang_size_relro_segment_1"

This reverts commit 8b7c6a1fbab5b0efc6abb50cdb24aef3954ac018.

PR ld/28743
PR ld/28819
* ldlang.c (lang_size_relro_segment_1): Revert 2022-01-14 change.
testsuite/ld-x86-64/pr28743-1.d: Likewise.
testsuite/ld-x86-64/pr28743-1.s: Likewise.
testsuite/ld-x86-64/x86-64.exp: Likewise.

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 7 Feb 2022 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 6 Feb 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agox86: Skip undefined symbol when finishing DT_RELR
H.J. Lu [Sat, 5 Feb 2022 15:26:31 +0000 (07:26 -0800)] 
x86: Skip undefined symbol when finishing DT_RELR

Don't abort for undefined symbol when finishing DT_RELR.  Instead, skip
undefined symbol.  Undefined symbol will be reported by relocate_section.

* elfxx-x86.c (elf_x86_size_or_finish_relative_reloc): Skip
undefined symbol in finishing phase.

(cherry picked from commit a9e61227c09c03d5cb54f9c88520baffc1d86c86)

3 years agoPR28827 testcase
Alan Modra [Sat, 5 Feb 2022 05:06:58 +0000 (15:36 +1030)] 
PR28827 testcase

This testcase triggers a stub sizing error with the patches applied
for PR28743 (commit 2f83249c13d8 and c804c6f98d34).

PR 28827
* testsuite/ld-powerpc/pr28827-1.s,
* testsuite/ld-powerpc/pr28827-1.d: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit 9810db10f726f47c8e878ca4b0b4b4f5e9c16a5d)
(cherry picked from commit 0acf434a23768449cbb4b3732355f3f2febecaee)

3 years agoEnable "size" as a dumpprog in ld
Alan Modra [Sat, 5 Feb 2022 07:05:09 +0000 (17:35 +1030)] 
Enable "size" as a dumpprog in ld

binutils/
* testsuite/lib/binutils-common.exp (run_dump_test): Reference
global SIZE and SIZEFLAGS.
ld/
* testsuite/config/default.exp: Define SIZE and SIZEFLAGS.

(cherry picked from commit cd8adbf3017272877c7e196e2e326f888f207bd9)

3 years agoDetect .eh_frame_hdr earlier for SIZEOF_HEADERS
Alan Modra [Fri, 4 Feb 2022 09:00:47 +0000 (19:30 +1030)] 
Detect .eh_frame_hdr earlier for SIZEOF_HEADERS

Current code detects the need for PT_GNU_EH_FRAME using a field set by
_bfd_elf_discard_section_eh_frame_hdr, which is called fairly late in
the linking process.  Use the elf hash table eh_info instead, which is
set up earlier by size_dynamic_sections.

* elf-bfd.h (struct output_elf_obj_tdata): Delete eh_frame_hdr.
(elf_eh_frame_hdr): Don't define.
(_bfd_elf_discard_section_eh_frame_hdr): Update prototype.
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Delete
abfd parameter.  Don't set elf_eh_frame_hdr.
* elf.c (elf_eh_frame_hdr): New function.
(get_program_header_size): Adjust elf_eh_frame_hdr call.
(_bfd_elf_map_sections_to_segments): Likewise.

(cherry picked from commit 8df52eeeb06efcccd6b840689ad8e11ebb264e7f)

3 years agoPowerPC64 treatment of absolute symbols
Alan Modra [Wed, 26 Jan 2022 00:01:36 +0000 (10:31 +1030)] 
PowerPC64 treatment of absolute symbols

Supporting -static-pie on PowerPC64 requires the linker to properly
treat SHN_ABS symbols for cases like glibc's _nl_current_LC_CTYPE_used
absolute symbol.  I've been slow to fix the linker on powerpc because
there is some chance that this will break some shared libraries or
PIEs.

bfd/
* elf64-ppc.c (ppc64_elf_check_relocs): Consolidate local sym
handling code.  Don't count dyn relocs against non-dynamic
absolute symbols.
(dec_dynrel_count): Adjust to suit.
(ppc64_elf_edit_toc): Don't remove entries for absolute symbols
when pic.
(allocate_got): Don't allocate space for got relocs against
non-dynamic absolute syms.
(ppc64_elf_layout_multitoc): Likewise.
(got_and_plt_relr): Likewise.
(ppc64_elf_size_dynamic_sections): Likewise for local got.
(got_and_plt_relr_for_local_syms): Likewise.
(ppc64_elf_size_stubs): Don't allocate space for relr either.
(ppc64_elf_relocate_section): Don't write relocs against non-dynamic
absolute symbols.  Don't optimise got and toc code sequences
loading absolute symbol entries.
ld/
* testsuite/ld-powerpc/abs-reloc.s,
* testsuite/ld-powerpc/abs-static.d,
* testsuite/ld-powerpc/abs-static.r,
* testsuite/ld-powerpc/abs-pie.d,
* testsuite/ld-powerpc/abs-pie.r,
* testsuite/ld-powerpc/abs-shared.d,
* testsuite/ld-powerpc/abs-shared.r,
* testsuite/ld-powerpc/abs-pie-relr.d,
* testsuite/ld-powerpc/abs-pie-relr.r,
* testsuite/ld-powerpc/abs-shared-relr.d,
* testsuite/ld-powerpc/abs-shared-relr.r: New tests.
* testsuite/ld-powerpc/powerpc.exp: Run them.

(cherry picked from commit 3a3a4c1fe4ccb1914d29fbf8f5930d55aacec78f)

3 years agoPR28827, assertion building LLVM 9 on powerpc64le-linux-gnu
Alan Modra [Thu, 27 Jan 2022 23:16:13 +0000 (09:46 +1030)] 
PR28827, assertion building LLVM 9 on powerpc64le-linux-gnu

The assertion is this one in ppc_build_one_stub
  BFD_ASSERT (stub_entry->stub_offset >= stub_entry->group->stub_sec->size);
It is checking that a stub doesn't overwrite the tail of a previous
stub, so not something trivial.

Normally, stub sizing iterates until no stubs are added, detected by
no change in stub section size.  Iteration also continues if no stubs
are added but one or more stubs increases in size, which also can be
detected by a change in stub section size.  But there is a
pathological case where stub section sizing decreases one iteration
then increases the next.  To handle that situation, stub sizing also
stops at more than STUB_SHRINK_ITER (20) iterations when calculated
stub section size is smaller.  The previous larger size is kept for
the actual layout (so that building the stubs, which behaves like
another iteration of stub sizing, will see the stub section sizes
shrink).  The problem with that stopping condition is that it assumes
that stub sizing is only affected by addresses external to the stub
sections, which isn't always true.

This patch fixes that by also keeping larger individual stub_offset
addresses past STUB_SHRINK_ITER.  It also catches a further
pathological case where one stub shrinks and another expands in such a
way that no stub section size change is seen.

PR 28827
* elf64-ppc.c (struct ppc_link_hash_table): Add stub_changed.
(STUB_SHRINK_ITER): Move earlier in file.
(ppc_size_one_stub): Detect any change in stub_offset.  Keep
larger one if past STUB_SHRINK_ITER.
(ppc64_elf_size_stubs): Iterate on stub_changed too.

(cherry picked from commit 0441f94fba61998b4bd18487aacf70a672df099c)

Re: PR28827, assertion building LLVM 9 on powerpc64le-linux-gnu

The previous patch wasn't quite correct.  The size and padding depends
on offset used in the current iteration, and if we're fudging the
offset past STUB_SHRINK_ITER then we'd better use that offset.  We
can't have plt_stub_pad using stub_sec->size as the offset.

PR 28827
* elf64-ppc.c (plt_stub_pad): Add stub_off param.
(ppc_size_one_stub): Set up stub_offset to value used in this
iteration before sizing the stub.  Adjust plt_stub_pad calls.

(cherry picked from commit 2405fc4016feadea33cb747d5654514f62b74ff4)

Re: PR28827, assertion building LLVM 9 on powerpc64le-linux-gnu

In trying to find a testcase for PR28827, I managed to hit a linker
error in bfd_set_section_contents with a .branch_lt input section
being too large for the output .branch_lt.

bfd/
PR 28827
* elf64-ppc.c (ppc64_elf_size_stubs): Set section size to
maxsize past STUB_SHRINK_ITER before laying out.  Remove now
unnecessary conditional setting of maxsize at start of loop.
ld/
* testsuite/ld-powerpc/pr28827-2.d,
* testsuite/ld-powerpc/pr28827-2.lnk,
* testsuite/ld-powerpc/pr28827-2.s: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit 9ff8aa7d418bc508dbd429576b93e30ed9dc5891)

3 years agoUpdate PowerPC64 symtocbase test
Alan Modra [Wed, 19 Jan 2022 13:17:41 +0000 (23:47 +1030)] 
Update PowerPC64 symtocbase test

Using a symbol other than .TOC. with @tocbase is an extension to the
ABI.  It is never valid to use a symbol without a definition in the
binary, and symbols on these expressions cannot be overridden.  Make
this explicit by using ".hidden" in the testcase.

* testsuite/ld-powerpc/symtocbase-1.s: Align data.  Make function
entry symbol hidden.
* testsuite/ld-powerpc/symtocbase-2.s: Likewise.
* testsuite/ld-powerpc/symtocbase.d: Adjust expected output.

(cherry picked from commit ef5684c2bdf4d4f9975650e3b7b8f9b0ff98abee)

3 years agoobjcopy --only-keep-debug
Alan Modra [Fri, 28 Jan 2022 12:38:27 +0000 (23:08 +1030)] 
objcopy --only-keep-debug

From: Peilin Ye <peilin.ye@bytedance.com>
objcopy's --only-keep-debug option has been broken for ELF files since
commit 8c803a2dd7d3.

  1. binutils/objcopy.c:setup_section() marks non-debug sections as
     SHT_NOBITS, then calls bfd_copy_private_section_data();
  2. If ISEC and OSEC share the same section flags,
     bfd/elf.c:_bfd_elf_init_private_section_data() restores OSEC's
     section type back to ISEC's section type, effectively undoing
     "make_nobits".

* objcopy.c (setup_section): Act on make_nobits after calling
bfd_copy_private_section_data.

(cherry picked from commit 7c4643efe7befea8e5063e8b56c0400fd8cee2d5)

3 years agoPR28826 x86_64 ld segfaults building xen
Alan Modra [Fri, 28 Jan 2022 03:59:34 +0000 (14:29 +1030)] 
PR28826 x86_64 ld segfaults building xen

Fallout from commit e86fc4a5bc37

PR 28826
* coffgen.c (coff_write_alien_symbol): Init dummy to zeros.

(cherry picked from commit 07c9f243b3a12cc6749bc02ee7b165859979348b)

3 years agoPR28753, buffer overflow in read_section_stabs_debugging_info
Alan Modra [Thu, 20 Jan 2022 03:28:38 +0000 (13:58 +1030)] 
PR28753, buffer overflow in read_section_stabs_debugging_info

PR 28753
* rddbg.c (read_section_stabs_debugging_info): Don't read past
end of section when concatentating stab strings.

(cherry picked from commit 085b299b71721e15f5c5c5344dc3e4e4536dadba)

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 5 Feb 2022 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 4 Feb 2022 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agox86: Update X86_64_GOT_TYPE_P to cover more GOT relocations
H.J. Lu [Thu, 3 Feb 2022 19:48:16 +0000 (11:48 -0800)] 
x86: Update X86_64_GOT_TYPE_P to cover more GOT relocations

Add R_X86_64_GOT32, R_X86_64_GOT64, R_X86_64_GOTPCREL64 and
R_X86_64_GOTPLT64 to X86_64_GOT_TYPE_P to cover more GOT relocations.

PR ld/28858
* elfxx-x86.h (X86_64_GOT_TYPE_P): Add R_X86_64_GOT32,
R_X86_64_GOT64, R_X86_64_GOTPCREL64 and R_X86_64_GOTPLT64.

(cherry picked from commit 8d26ee1cd166b8565df17c82e7ecc9d35b5a367f)

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 3 Feb 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoStop the BFD library from complaining that dwarf debug string sections are too big.
Nick Clifton [Wed, 2 Feb 2022 17:07:31 +0000 (17:07 +0000)] 
Stop the BFD library from complaining that dwarf debug string sections are too big.

PR 28834
* dwarf2.c (read_section): Change the heuristic that checks for
overlarge dwarf debug info sections.

3 years agoUpdated French translation for the ld/ and gold/ sub-directories
Nick Clifton [Wed, 2 Feb 2022 15:05:50 +0000 (15:05 +0000)] 
Updated French translation for the ld/ and gold/ sub-directories

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 2 Feb 2022 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 1 Feb 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoImport a patch from the GCC mainline to fix an infinite recursion in the Rust demangler.
Nick Clifton [Mon, 31 Jan 2022 14:38:12 +0000 (14:38 +0000)] 
Import a patch from the GCC mainline to fix an infinite recursion in the Rust demangler.

PR 98886
PR 99935
* rust-demangle.c (struct rust_demangler): Add a recursion
counter.
(demangle_path): Increment/decrement the recursion counter upon
entry and exit.  Fail if the counter exceeds a fixed limit.
(demangle_type): Likewise.
(rust_demangle_callback): Initialise the recursion counter,
disabling if requested by the option flags.

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 31 Jan 2022 00:01:30 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 30 Jan 2022 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 29 Jan 2022 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoUpdated French translation for the gas sub-directory
Nick Clifton [Fri, 28 Jan 2022 12:17:13 +0000 (12:17 +0000)] 
Updated French translation for the gas sub-directory

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 28 Jan 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoUpdated Swedish translation for the binutils subdirectory
Nick Clifton [Thu, 27 Jan 2022 11:22:20 +0000 (11:22 +0000)] 
Updated Swedish translation for the binutils subdirectory

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 27 Jan 2022 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agold: Rewrite lang_size_relro_segment_1
H.J. Lu [Fri, 14 Jan 2022 21:48:36 +0000 (13:48 -0800)] 
ld: Rewrite lang_size_relro_segment_1

1. Compute the desired PT_GNU_RELRO segment base and find the maximum
section alignment of sections starting from the PT_GNU_RELRO segment.
2. Find the first preceding load section.
3. Don't add the 1-page gap between the first preceding load section and
the relro segment if the maximum page size >= the maximum section
alignment.  Align the PT_GNU_RELRO segment first.  Subtract the maximum
page size if therer is still a 1-page gap.

PR ld/28743
PR ld/28819
* ldlang.c (lang_size_relro_segment_1): Rewrite.
* testsuite/ld-x86-64/pr28743-1.d: New file.
* testsuite/ld-x86-64/pr28743-1.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr28743-1.

(cherry picked from commit c804c6f98d342c3d46f73d7a7ec6229d5ab1c9f3)

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 26 Jan 2022 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoFix problem building binutils on SPARC/amd64
Klaus Ziegler [Tue, 25 Jan 2022 17:32:03 +0000 (17:32 +0000)] 
Fix problem building binutils on SPARC/amd64

PR 28816
* elf/common.h (AT_SUN_HWCAP): Make definition conditional.

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 25 Jan 2022 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoFix a problem building the libiberty library with gcc-12.
Martin Sebor [Mon, 24 Jan 2022 18:00:17 +0000 (18:00 +0000)] 
Fix a problem building the libiberty library with gcc-12.

PR 28779
* regex.c: Suppress -Wuse-after-free.

3 years agoUpdate Bulgarian, French, Romaniam and Ukranian translation for some of the sub-direc...
Nick Clifton [Mon, 24 Jan 2022 14:25:09 +0000 (14:25 +0000)] 
Update Bulgarian, French, Romaniam and Ukranian translation for some of the sub-directories

3 years agoRestore accidentally deleted allocfail.sh source file
Nick Clifton [Mon, 24 Jan 2022 14:00:08 +0000 (14:00 +0000)] 
Restore accidentally deleted allocfail.sh source file

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 24 Jan 2022 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 23 Jan 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAllow inferring tmp_prefix from the dll name from a def file
Martin Storsj? [Sat, 22 Jan 2022 14:32:35 +0000 (14:32 +0000)] 
Allow inferring tmp_prefix from the dll name from a def file

3 years agoAdjust default page sizes for haiku arm.
Alexander von Gluck IV [Sat, 22 Jan 2022 14:20:51 +0000 (14:20 +0000)] 
Adjust default page sizes for haiku arm.

* configure.tgt (arm-haiku): Fix typo.
* emulparams/armelf_haiku.su (MAXPAGESIZE): Use the default value.
(COMMONPAGESIZE): Likewise.

3 years agoCHange version number to 2.37.90 and regenerate files
Nick Clifton [Sat, 22 Jan 2022 12:34:53 +0000 (12:34 +0000)] 
CHange version number to 2.37.90 and regenerate files

3 years agoAdd markers for 2.38 branch
Nick Clifton [Sat, 22 Jan 2022 12:08:55 +0000 (12:08 +0000)] 
Add markers for 2.38 branch

3 years agoRISC-V: create new frag after alignment.
Lifang Xia [Thu, 20 Jan 2022 02:42:55 +0000 (10:42 +0800)] 
RISC-V: create new frag after alignment.

PR 28793:

The alignment may be removed in linker. We need to create new frag after
alignment to prevent the assembler from computing static offsets.

gas/
* config/tc-riscv.c (riscv_frag_align_code): Create new frag.

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 22 Jan 2022 00:00:12 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agogdb: include gdbsupport/buildargv.h in ser-mingw.c
Simon Marchi [Fri, 21 Jan 2022 16:33:29 +0000 (11:33 -0500)] 
gdb: include gdbsupport/buildargv.h in ser-mingw.c

Fixes:

      CXX    ser-mingw.o
    /home/simark/src/binutils-gdb/gdb/ser-mingw.c: In function ‘int pipe_windows_open(serial*, const char*)’:
    /home/simark/src/binutils-gdb/gdb/ser-mingw.c:870:3: error: ‘gdb_argv’ was not declared in this scope
      870 |   gdb_argv argv (name);
          |   ^~~~~~~~

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28802
Change-Id: I7f3e8ec5f9ca8582d587545fdf6b69901259f199

3 years agoUpdated Serbian translation for the ld sub-directory
Nick Clifton [Fri, 21 Jan 2022 15:42:18 +0000 (15:42 +0000)] 
Updated Serbian translation for the ld sub-directory

3 years agogdb/doc: fill in two missing @r
Andrew Burgess [Fri, 21 Jan 2022 12:49:48 +0000 (12:49 +0000)] 
gdb/doc: fill in two missing @r

I noticed two places in the docs where we appear to be missing @r.
makeinfo seems to do the correct things despite these being
missing (at least, I couldn't see any difference in the pdf or info
output), but it doesn't hurt to have the @r in place.

3 years agodrop old unused stamp-h.in file
Mike Frysinger [Fri, 21 Jan 2022 04:09:42 +0000 (23:09 -0500)] 
drop old unused stamp-h.in file

This was needed by ancient versions of automake, but that hasn't been
the case since at least automake-1.5, so punt this from the tree.

3 years agogdbsupport/gdb_regex.cc: replace defs.h include with common-defs.h
Simon Marchi [Fri, 21 Jan 2022 03:57:11 +0000 (22:57 -0500)] 
gdbsupport/gdb_regex.cc: replace defs.h include with common-defs.h

This was forgotten when gdb_regex was moved from gdb to gdbsupport.

Change-Id: I73b446f71861cabbf7afdb7408ef9d59fa64b804

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 21 Jan 2022 00:00:15 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAvoid bad breakpoints with --gc-sections
Tom Tromey [Thu, 13 Jan 2022 16:48:18 +0000 (09:48 -0700)] 
Avoid bad breakpoints with --gc-sections

We found a case where --gc-sections can cause gdb to set an invalid
breakpoint.  In the included test case, gdb will set a breakpoint with
two locations, one of which is 0x0.

The code in lnp_state_machine::check_line_address is intended to
filter out this sort of problem, but in this case, the entire CU is
empty, causing unrelocated_lowpc==0x0 -- which circumvents the check.

It seems to me that if a CU is empty like this, then it is ok to
simply ignore the line table, as there won't be any locations anyway.

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Jan 2022 00:00:18 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAdd `set print array-indexes' tests for C/C++ arrays
Maciej W. Rozycki [Wed, 19 Jan 2022 21:55:10 +0000 (21:55 +0000)] 
Add `set print array-indexes' tests for C/C++ arrays

Add `set print array-indexes' tests for C/C++ arrays, complementing one
for Fortran arrays.

3 years agoRespect `set print array-indexes' with Fortran arrays
Maciej W. Rozycki [Wed, 19 Jan 2022 21:55:10 +0000 (21:55 +0000)] 
Respect `set print array-indexes' with Fortran arrays

Add `set print array-indexes' handling for Fortran arrays.  Currently
the setting is ignored and indices are never shown.

Keep track of the most recent index handled so that any outstanding
repeated elements printed when the limit set by `set print elements' is
hit have the correct index shown.

Output now looks like:

(gdb) set print array-indexes on
(gdb) print array_1d
$1 = ((-2) = 1, (-1) = 1, (0) = 1, (1) = 1, (2) = 1)
(gdb) set print repeats 4
(gdb) set print elements 12
(gdb) print array_2d
$2 = ((-2) = ((-2) = 2, <repeats 5 times>) (-1) = ((-2) = 2, <repeats 5 times>) (0) = ((-2) = 2, (-1) = 2, ...) ...)
(gdb)

for a 5-element vector and a 5 by 5 array filled with the value of 2.

3 years agoAdd `set print repeats' tests for C/C++ arrays
Maciej W. Rozycki [Wed, 19 Jan 2022 21:55:10 +0000 (21:55 +0000)] 
Add `set print repeats' tests for C/C++ arrays

Add `set print repeats' tests for C/C++ arrays, complementing one for
Fortran arrays and covering the different interpretation of the `set
print elements' setting in particular where the per-dimension count of
the elements handled is matched against the trigger rather than the
total element count as with Fortran arrays.

3 years agoRespect `set print repeats' with Fortran arrays
Maciej W. Rozycki [Wed, 19 Jan 2022 21:55:10 +0000 (21:55 +0000)] 
Respect `set print repeats' with Fortran arrays

Implement `set print repeats' handling for Fortran arrays.  Currently
the setting is ignored and always treated as if no limit was set.

Unlike the generic array walker implemented decades ago the Fortran one
is a proper C++ class.  Rather than trying to mimic the old walker then,
which turned out a bit of a challenge where interacting with the `set
print elements' setting, write it entirely from scratch, by adding an
extra specialization handler method for processing dimensions other than
the innermost one and letting the specialization class call the `walk_1'
method from the handler as it sees fit.  This way repeats can be tracked
and the next inner dimension recursed into as a need arises only, or
unconditionally in the base class.

Keep track of the dimension number being handled in the class rather as
a parameter to the walker so that it does not have to be passed across
by the specialization class.

Use per-dimension element count tracking, needed to terminate processing
early when the limit set by `set print elements' is hit.  This requires
extra care too where the limit triggers exactly where another element
that is a subarray begins.  In that case rather than recursing we need
to terminate processing or lone `(...)' would be printed.  Additionally
if the skipped element is the last one in the current dimension we need
to print `...' by hand, because `continue_walking' won't print it at the
upper level, because it can see the last element has already been taken
care of.

Preserve the existing semantics of `set print elements' where the total
count of the elements handled is matched against the trigger level which
is unlike with the C/C++ array printer where the per-dimension element
count is used instead.

Output now looks like:

(gdb) set print repeats 4
(gdb) print array_2d
$1 = ((2, <repeats 5 times>) <repeats 5 times>)
(gdb) set print elements 12
(gdb) print array_2d
$2 = ((2, <repeats 5 times>) (2, <repeats 5 times>) (2, 2, ...) ...)
(gdb)

for a 5 by 5 array filled with the value of 2.

Amend existing test cases accordingly that rely on the current incorrect
behavior and explicitly request that there be no limit for printing
repeated elements there.

Add suitable test cases as well covering sliced arrays in particular.

Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>
3 years agofbsd-nat: Add include for gdb_argv.
John Baldwin [Wed, 19 Jan 2022 16:30:38 +0000 (08:30 -0800)] 
fbsd-nat: Add include for gdb_argv.

3 years agoPowerPC64 DT_RELR ELFv1
Alan Modra [Wed, 19 Jan 2022 02:49:51 +0000 (13:19 +1030)] 
PowerPC64 DT_RELR ELFv1

More fun with R_PPC64_NONE found in .opd.  Fixed by the
allocate_dynrelocs and ppc64_elf_size_dynamic_sections changes, and
since we are doing ifunc, opd and SYMBOL_REFERENCES_LOCAL tests later,
don't duplicate that work in check_relocs.

* elf64-ppc.c (ppc64_elf_check_relocs): Remove opd and ifunc
conditions for rel_count.
(dec_dynrel_count): Likewise.
(allocate_dynrelocs): Test for opd and ifunc when allocating
relative relocs.
(ppc64_elf_size_dynamic_sections): Likewise.

3 years agoPowerPC64 DT_RELR local PLT
Alan Modra [Wed, 19 Jan 2022 02:58:04 +0000 (13:28 +1030)] 
PowerPC64 DT_RELR local PLT

Similarly to the local GOT case.

* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
space for PLT relocs against local syms when enable_dt_relr.

3 years agoPowerPC64 DT_RELR local GOT
Alan Modra [Wed, 19 Jan 2022 00:23:53 +0000 (10:53 +1030)] 
PowerPC64 DT_RELR local GOT

Fixes another case where we end up with superfluous R_PPC64_NONE.

* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
space for GOT relocs against non-TLS local syms when enable_dt_relr.
(ppc64_elf_layout_multitoc): Likewise.

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Jan 2022 00:00:10 +0000 (00:00 +0000)] 
Automatic date update in version.in