]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
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

3 years agoRe: PowerPC64 DT_RELR
Alan Modra [Tue, 18 Jan 2022 23:05:00 +0000 (09:35 +1030)] 
Re: PowerPC64 DT_RELR

HJ: "There are 238 R_PPC64_NONEs in libc.so.6 alone."
Indeed, let's make them go away.  I had the SYMBOL_REFERENCES_LOCAL
test in the wrong place.  check_relocs is too early to know whether a
symbol is dynamic in a shared library.  Lots of glibc symbols are made
local by version script, but that doesn't happen until
size_dynamic_sections.

* elf64-ppc.c (ppc64_elf_check_relocs): Don't count relative relocs
here depending on SYMBOL_REFERENCES_LOCAL.
(dec_dynrel_count): Likewise.
(allocate_dynrelocs): Do so here instead.

3 years agoFix the remote-sim.c build
Tom Tromey [Tue, 18 Jan 2022 21:12:23 +0000 (14:12 -0700)] 
Fix the remote-sim.c build

My earlier patch to move gdb_argv broke the remote-sim.c build.  This
patch fixes the bug.  I'm checking it in.

3 years agogdbserver: introduce remote_debug_printf
Simon Marchi [Mon, 17 Jan 2022 02:16:02 +0000 (21:16 -0500)] 
gdbserver: introduce remote_debug_printf

Add remote_debug_printf, and use it for all debug messages controlled by
remote_debug.

Change remote_debug to be a bool, which is trivial in this case.

Change-Id: I90de13cb892faec3830047b571661822b126d6e8

3 years agogdbserver: introduce threads_debug_printf, THREADS_SCOPED_DEBUG_ENTER_EXIT
Simon Marchi [Mon, 17 Jan 2022 02:27:58 +0000 (21:27 -0500)] 
gdbserver: introduce threads_debug_printf, THREADS_SCOPED_DEBUG_ENTER_EXIT

Add the threads_debug_printf and THREADS_SCOPED_DEBUG_ENTER_EXIT, which
use the logging infrastructure from gdbsupport/common-debug.h.  Replace
all debug_print uses that are predicated by debug_threads with
threads_dethreads_debug_printf.  Replace uses of the debug_enter and
debug_exit macros with THREADS_SCOPED_DEBUG_ENTER_EXIT, which serves
essentially the same purpose, but allows showing what comes between the
enter and the exit in an indented form.

Note that "threads" debug is currently used for a bit of everything in
GDBserver, not only threads related stuff.  It should ideally be cleaned
up and separated logically as is done in GDB, but that's out of the
scope of this patch.

Change-Id: I2d4546464462cb4c16f7f1168c5cec5a89f2289a

3 years agogdbserver: turn debug_threads into a boolean
Simon Marchi [Mon, 17 Jan 2022 02:21:24 +0000 (21:21 -0500)] 
gdbserver: turn debug_threads into a boolean

debug_threads is always used as a boolean.  Except in ax.cc and
tracepoint.cc.  These files have their own macros that use
debug_threads, and have a concept of verbosity level.  But they both
have a single level, so it's just a boolean in the end.

Remove this concept of level.  If we ever want to re-introduce it, I
think it will be better implemented in a more common location.

Change debug_threads to bool and adjust some users that were treating it
as an int.

Change-Id: I137f596eaf763a08c977dd74417969cedfee9ecf

3 years agoSimplify Ada catchpoints
Tom Tromey [Thu, 13 Jan 2022 01:11:53 +0000 (18:11 -0700)] 
Simplify Ada catchpoints

All the Ada catchpoints use the same breakpoint_ops contents, because
the catchpoint itself records its kind.  This patch simplifies the
code by removing the redundant ops structures.

3 years agoMove "catch exec" to a new file
Tom Tromey [Wed, 12 Jan 2022 23:13:23 +0000 (16:13 -0700)] 
Move "catch exec" to a new file

The "catch exec" code is reasonably self-contained, and so this patch
moves it out of breakpoint.c (the second largest source file in gdb)
and into a new file, break-catch-exec.c.

3 years agoMove "catch fork" to a new file
Tom Tromey [Wed, 12 Jan 2022 23:03:33 +0000 (16:03 -0700)] 
Move "catch fork" to a new file

The "catch fork" code is reasonably self-contained, and so this patch
moves it out of breakpoint.c (the second largest source file in gdb)
and into a new file, break-catch-fork.c.

3 years agoUnify "catch fork" and "catch vfork"
Tom Tromey [Wed, 12 Jan 2022 22:55:50 +0000 (15:55 -0700)] 
Unify "catch fork" and "catch vfork"

I noticed that "catch fork" and "catch vfork" are nearly identical.
This patch simplifies the code by unifying these two cases.

3 years agoMove gdb_regex to gdbsupport
Tom Tromey [Sat, 1 Jan 2022 18:31:47 +0000 (11:31 -0700)] 
Move gdb_regex to gdbsupport

This moves the gdb_regex convenience class to gdbsupport.

3 years agoIntroduce gdb-hashtab module in gdbsupport
Tom Tromey [Tue, 21 Dec 2021 23:48:38 +0000 (16:48 -0700)] 
Introduce gdb-hashtab module in gdbsupport

gdb has some extensions and helpers for working with the libiberty
hash table.  This patch consolidates these and moves them to
gdbsupport.

3 years agoMove gdb obstack code to gdbsupport
Tom Tromey [Tue, 21 Dec 2021 23:38:32 +0000 (16:38 -0700)] 
Move gdb obstack code to gdbsupport

This moves the gdb-specific obstack code -- both extensions like
obconcat and obstack_strdup, and things like auto_obstack -- to
gdbsupport.

3 years agoMove gdb_argv to gdbsupport
Tom Tromey [Wed, 26 Feb 2020 01:14:19 +0000 (18:14 -0700)] 
Move gdb_argv to gdbsupport

This moves the gdb_argv class to a new header in gdbsupport.

3 years agoSimplify event_location_probe
Tom Tromey [Fri, 14 Jan 2022 16:06:11 +0000 (09:06 -0700)] 
Simplify event_location_probe

event_location_probe currently stores two strings, but really only
needs one.  This patch simplifies it and removes some unnecessary
copies as well.

3 years agoUse std::string in event_location
Tom Tromey [Fri, 14 Jan 2022 15:53:35 +0000 (08:53 -0700)] 
Use std::string in event_location

This changes event_location to use std::string, removing some manual
memory management, and an unnecessary string copy.

3 years agoSplit event_location into subclasses
Tom Tromey [Fri, 14 Jan 2022 15:29:42 +0000 (08:29 -0700)] 
Split event_location into subclasses

event_location uses the old C-style discriminated union approach.
However, it's better to use subclassing, as this makes the code
clearer and removes some chances for error.  This also enables future
cleanups to avoid manual memory management and copies.

3 years agoRemove EL_* macros from location.c
Tom Tromey [Fri, 14 Jan 2022 14:33:33 +0000 (07:33 -0700)] 
Remove EL_* macros from location.c

This patch removes the old-style EL_* macros from location.c.  This
cleans up the code by itself, IMO, but also enables further cleanups
in subsequent patches.

3 years agoBoolify explicit_to_string_internal
Tom Tromey [Fri, 14 Jan 2022 14:26:12 +0000 (07:26 -0700)] 
Boolify explicit_to_string_internal

This changes explicit_to_string_internal to use 'bool' rather than
'int'.

3 years agoRemove a use of xfree in location.c
Tom Tromey [Fri, 14 Jan 2022 14:24:18 +0000 (07:24 -0700)] 
Remove a use of xfree in location.c

This small cleanup removes a use of xfree from location.c, by
switching to unique_xmalloc_ptr.  One function is only used in
location.c, so it is made static.  And, another function is changed to
avoid a copy.

3 years agogdb: use ptid_t::to_string instead of target_pid_to_str in debug statements
Simon Marchi [Sun, 16 Jan 2022 04:45:06 +0000 (23:45 -0500)] 
gdb: use ptid_t::to_string instead of target_pid_to_str in debug statements

Same idea as 0fab79556484 ("gdb: use ptid_t::to_string in infrun debug
messages"), but throughout GDB.

Change-Id: I62ba36eaef29935316d7187b9b13d7b88491acc1

3 years agogdb: preserve `|` in connection details string
Andrew Burgess [Wed, 12 Jan 2022 17:13:38 +0000 (17:13 +0000)] 
gdb: preserve `|` in connection details string

Consider this GDB session:

  $ gdb -q
  (gdb) target remote  | gdbserver - ~/tmp/hello.x
  Remote debugging using | gdbserver - ~/tmp/hello.x
  ... snip ...
  (gdb) info connections
    Num  What                              Description
  * 1    remote gdbserver - ~/tmp/hello.x  Remote target using gdb-specific protocol
  (gdb) python conn = gdb.selected_inferior().connection
  (gdb) python print(conn.details)
  gdbserver - ~/tmp/hello.x
  (gdb)

I think there are two things wrong here, first in the "What" column of
the 'info connections' output, I think the text should be:

  remote | gdbserver - ~/tmp/hello.x

to correctly show the user how the connection was established.  And in
a similar fashion, I think that the `details` string of the
gdb.TargetConnection object should be:

  | gdbserver - ~/tmp/hello.x

This commit makes this change.  Currently the '|' is detected and
removed in gdb/serial.c.  The string passed to the pipe_ops
structure (from gdb/ser-pipe.c), doesn't then, contain the `|`, this
is instead implied by the fact that it is a pipes based implementation
of the serial_ops interface.

After this commit we still detect the `|` in gdb/serial.c, but we now
store the full string (including the `|`) in the serial::name member
variable.

For pipe based serial connections, this name is only used for
displaying the two fields I mention above, and in pipe_open (from
gdb/ser-pipe.c), and in pipe_open, we now know to skip over the `|`.

The benefit I see from this change is that GDB's output now more
accurately reflects the commands used to start a target, thus making
it easier for a user to understand what is going on.

3 years agogdb: testsuite: print explicit test result for gdb.base/dfp-test.exp
Tiezhu Yang [Tue, 18 Jan 2022 07:17:57 +0000 (15:17 +0800)] 
gdb: testsuite: print explicit test result for gdb.base/dfp-test.exp

In the current code, if decimal floating point is not supported for
this target, there is no binary file dfp-test, and also there is no
test result after execute the following commands:

  $ make check-gdb TESTS="gdb.base/dfp-test.exp"
  $ grep error gdb/testsuite/gdb.log
  /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.c:39:1: error: decimal floating point not supported for this target
  [...]
  $ cat gdb/testsuite/gdb.sum
  [...]
  Running target unix
  Running /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.exp ...

  === gdb Summary ===
  [...]

With this patch:

  $ make check-gdb TESTS="gdb.base/dfp-test.exp"
  $ cat gdb/testsuite/gdb.sum
  [...]
  Running target unix
  Running /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.exp ...
  UNSUPPORTED: gdb.base/dfp-test.exp: decimal floating point not supported for this target.

  === gdb Summary ===

  # of unsupported tests 1
  [...]

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
3 years agobfd/elf64-ppc.c: fix clang -Wbitwise-instead-of-logical warning in ppc64_elf_check_in...
Simon Marchi [Sun, 16 Jan 2022 03:13:07 +0000 (22:13 -0500)] 
bfd/elf64-ppc.c: fix clang -Wbitwise-instead-of-logical warning in ppc64_elf_check_init_fini

I see this error with clang-14:

      CC       elf64-ppc.lo
    /home/smarchi/src/binutils-gdb/bfd/elf64-ppc.c:13131:11: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
      return (check_pasted_section (info, ".init")
             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix by replacing & with &&.  But given that the check_pasted_section
function has side-effects and we want to make sure both calls are made,
assign to temporary variables before evaluating the `&&`.

Change-Id: I849e1b2401bea5f4d8ef3ab9af99ba9e3ef42490

3 years agoPR28029, debuginfod tests
Alan Modra [Sun, 21 Nov 2021 23:46:01 +0000 (10:16 +1030)] 
PR28029, debuginfod tests

binutils/NEWS says of the change in --process-links semantics:
  If other debug section display options are also enabled (eg
  --debug-dump=info) then the contents of matching sections in both the main
  file and the separate debuginfo file *will* be displayed.  This is because in
  most cases the debug section will only be present in one of the files.

Implying that debug info is dumped without --process-links.  Indeed
that appears to be the case for readelf.  This does the same for
objdump.

PR 28029
* objdump.c (dump_bfd): Do not exit early when !is_mainfile
&& !processlinks, instead just exclude non-debug output.
(dump_dwarf): Add is_mainfile parameter and pass to
dump_dwarf_section.
(dump_dwarf_section): Only display debug sections when
!is_mainfile and !process_links.

3 years agoCheck thin archive element file size against archive header
Alan Modra [Tue, 28 Dec 2021 12:21:55 +0000 (22:51 +1030)] 
Check thin archive element file size against archive header

Makes it a little less likely for someone to break their thin archives.

* archive.c (_bfd_get_elt_at_filepos): Check thin archive
element file size.

3 years agolang_size_relro_segment tidy
Alan Modra [Fri, 14 Jan 2022 01:54:22 +0000 (12:24 +1030)] 
lang_size_relro_segment tidy

This function has seen too many minimal change style edits.
No functional changes in this patch.

* ldlang.c (lang_size_relro_segment): Tidy.

3 years agoPowerPC64 DT_RELR
Alan Modra [Thu, 6 Jan 2022 21:19:16 +0000 (07:49 +1030)] 
PowerPC64 DT_RELR

PowerPC64 takes a more traditional approach to DT_RELR than x86.  Count
relative relocs in check_relocs, allocate space for them and output in
the usual places but not doing so when enable_dt_relr.  DT_RELR is
sized in the existing ppc stub relaxation machinery, run via the
linker's ldemul_after_allocation hook.  DT_RELR is output in the same
function that writes ppc stubs, run via ldemul_finish.

This support should be considered experimental.

bfd/
* elf64-ppc.c (struct ppc_local_dyn_relocs): Renamed from
ppc_dyn_relocs.  Add rel_count field.  Update uses.
(struct ppc_dyn_relocs): New.  Replace all uses of elf_dyn_relocs.
(struct ppc_link_hash_table): Add relr_alloc, relr_count and
relr_addr.
(ppc64_elf_copy_indirect_symbol): Merge rel_count.
(ppc64_elf_check_relocs): Init rel_count for global and local syms.
(dec_dynrel_count): Change r_info param to reloc pointer.  Update
all callers.  Handle decrementing rel_count.
(allocate_got): Don't allocate space for relative relocs when
enable_dt_relr.
(allocate_dynrelocs): Likewise.
(ppc64_elf_size_dynamic_sections): Likewise.  Handle srelrdyn.
(ppc_build_one_stub): Don't emit relative relocs on .branch_lt.
(compare_relr_address, append_relr_off): New functions.
(got_and_plt_relr_for_local_syms, got_and_plt_relr): Likewise.
(ppc64_elf_size_stubs): Size .relr.syn.
(ppc64_elf_build_stubs): Emit .relr.dyn.
(build_global_entry_stubs_and_plt): Don't output relative relocs
when enable_dt_relr.
(write_plt_relocs_for_local_syms): Likewise.
(ppc64_elf_relocate_section): Likewise.
binutils/
* testsuite/lib/binutils-common.exp (supports_dt_relr): Add
powerpc64.
ld/
* emulparams/elf64ppc.sh: Source dt-relr.sh.
* testsuite/ld-elf/dt-relr-2b.d: Adjust for powerpc.
* testsuite/ld-elf/dt-relr-2c.d: Likewise.
* testsuite/ld-elf/dt-relr-2d.d: Likewise.
* testsuite/ld-elf/dt-relr-2e.d: Likewise.

3 years agotweak __ehdr_start visibility and flags for check_relocs
Alan Modra [Wed, 12 Jan 2022 13:12:23 +0000 (23:42 +1030)] 
tweak __ehdr_start visibility and flags for check_relocs

bfd/
* elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Test linker_def.
ld/
* ldelf.c (ldelf_before_allocation): Don't force __ehdr_start
local and hidden here..
* ldlang.c (lang_symbol_tweaks): ..do so here instead and set
def_regular and linker_def for check_relocs.  New function
extracted from lang_process.

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

3 years agoUpdate the config.guess and config.sub files from the master repository and regenerat...
Nick Clifton [Mon, 17 Jan 2022 16:21:22 +0000 (16:21 +0000)] 
Update the config.guess and config.sub files from the master repository and regenerate files.

3 years agoFix Z80 assembly failure.
Sergey Belyashov [Mon, 17 Jan 2022 13:00:17 +0000 (13:00 +0000)] 
Fix Z80 assembly failure.

PR 28762
* app.c (do_scrub_chars): Correct handling when the symbol is not 'af'.

3 years agogdb/infrun: rename variable and move to more specific scope
Simon Marchi [Mon, 10 Jan 2022 21:40:54 +0000 (16:40 -0500)] 
gdb/infrun: rename variable and move to more specific scope

Move the "started" variable to the scope it's needed, and rename it to
"step_over_started".

Change-Id: I56f3384dbd328f55198063bb855edda10f1492a3

3 years agox86: adjust struct instr_info field types
Jan Beulich [Mon, 17 Jan 2022 09:26:43 +0000 (10:26 +0100)] 
x86: adjust struct instr_info field types

Now that this lives on the stack, let's have it be a little less
wasteful in terms of space. Switch boolean fields to "bool" (also when
this doesn't change their size) and also limit the widths of "rex",
"rex_used", "op_ad", and "op_index". Do a little bit of re-ordering as
well to limit the number of padding holes.

3 years agox86: drop index16 field
Jan Beulich [Mon, 17 Jan 2022 09:26:21 +0000 (10:26 +0100)] 
x86: drop index16 field

There's a single use on a generally infrequently taken code path. Put
the necessary conditional there instead.

3 years agox86: drop most Intel syntax register name arrays
Jan Beulich [Mon, 17 Jan 2022 09:26:01 +0000 (10:26 +0100)] 
x86: drop most Intel syntax register name arrays

By making use of, in particular, oappend_maybe_intel() there's no need
for this redundant set of static data.