aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-12-11Automatic date update in version.inHEADmasterGDB Administrator1-1/+1
2025-12-10LoongArch32: Fix and add testcasesLulu Cai10-79/+211
Fixed several test failures caused by the LoongArch32 assembler adding labels during assembly. Additionally, skipped tests specific to LoongArch64. Add test for new relocations. Add test for tls type transition, got relaxation and call30 relaxation.
2025-12-10LoongArch: Add linker relaxation for got_pcadd_hi20 and got_pcadd_lo12mengqinggang3-20/+53
.L1: pcaddu12i $t0, %got_pcadd_hi20(a) -> pcaddu12i $t0, %pcadd_hi20(a) ld.w/d $t0, $t0, %got_pcadd_lo12(.L1) -> addi.w/d $t0, $t0, %pcadd_lo12(.L1)
2025-12-10LoongArch: Add support for tls type transition on LA32mengqinggang3-159/+302
desc -> le ie -> le desc -> ie For desc/ie -> le, need to change the symbol of le_lo12 to the symbol of [desc|ie]_pcadd_hi20.
2025-12-10LoongArch: Add linker relaxation support for R_LARCH_CALL30mengqinggang2-4/+6
Relax call30 to bl, relax tail30 to b.
2025-12-10LoongArch: LA32R macros expandmengqinggang1-0/+39
Define a symbol .Lpcadd_hi* at R_LARCH_*_PCADD_HI20 if the instruction expand from macro. Change the symbol of R_LARCH_PCADD_LO12 to .Lpcadd_hi* if the instruction expand from macro.
2025-12-10LoongArch: LA32 macros supportmengqinggang1-20/+57
Change pcalau12i to pcaddu12i for LA32 macros. Add call/tail and call30/tail30 macros, call/tail can expand to call36/tail36 or call30/tail30 by mabi option.
2025-12-10LoongArch: Add processing for LA32/LA32R relocationsmengqinggang3-26/+284
R_LARCH_CALL30: pcaddu12i $ra, %call30(func) jirl $ra, $ra, 0 Similar with R_LARCH_CALL36, pcaddu12i and jirl must be adjacent. R_LARCH_PCADD_HI20, R_LARCH_PCADD_LO12: .Lpcadd_hi0: pcaddu12i $t0, %pcadd_hi20(sym) addi.w $t0, $t0, %pcadd_lo12(.Lpcadd_hi0) Similar with RISCV PCREL_HI20, PCREL_LO12, R_LARCH_PCADD_LO12 reference to the symbol at R_LARCH_PCADD_HI20.
2025-12-10LoongArch: Add LA32 and LA32R relocationsmengqinggang6-13/+318
LA32 and LA32R do not have pcaddu18i. LA32R does not have pcalau12i. Add R_LARCH_CALL30 for pcaddu12i + jirl used in LA32 and LA32R. Add R_LARCH_*_PCADD_HI20 for pcaddu12i used in LA32R. Add R_LARCH_*_PCADD_LO12 for addi.w/ld.w used in LA32R.
2025-12-10LoongArch: Enable all instructions by default on LA32 like LA64mengqinggang1-43/+44
Glibc checks LSX/LASX support when configure. Kernel has float instructions but with -msoft-float option.
2025-12-10LoongArch: Add R_LARCH_TLS_LE_ADD_R relocation support for add.wmengqinggang1-0/+1
Fix compiler error for "add.w $r12,$r12,$r2,%le_add_r(a)".
2025-12-10LoongArch: Change DWARF2_CIE_DATA_ALIGNMENT to -4 for loongarch32Jiajie Chen2-1/+7
2025-12-10LoongArch: Enable loongarch_elf64_vec loongarch64_pei_vec on LA32 targetmengqinggang1-1/+1
Fix -march=loongarch64 error on LA32 target.
2025-12-10Revert "[gdb/guile] Use SCM_DEBUG_TYPING_STRICTNESS 0"Thiago Jung Bauermann1-18/+11
This reverts commit 852cbc7ffadf9daf173e13ea56caff49d52733af. It fixed the build with libguile v2.0.9, but now GDB only supports Guile >= 2.2. I was able to build GDB using -std=c++20 with both Guile 2.2 and Guile 3.0 (tested with GCC 14.3) without any error or warning. Approved-By: Tom Tromey <tom@tromey.com>
2025-12-10GDB: Guile: Remove procedures ineffectual since Guile 2.2Thiago Jung Bauermann4-101/+8
The manual mentions since GDB 10 that the functions for getting and setting the size of memory port buffers are deprecated, and don't work when using Guile 2.2 or later. Since now GDB only supports Guile 2.2 and newer, perform the promised removal. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Tom Tromey <tom@tromey.com>
2025-12-10GDB: Guile: Remove code meant for Guile < 2.2Thiago Jung Bauermann1-20/+0
Approved-By: Tom Tromey <tom@tromey.com>
2025-12-10Automatic date update in version.inGDB Administrator1-1/+1
2025-12-10[gdb] Fix whitespace in NEWSTom de Vries2-2/+2
Fix this: ... $ empty=$(git hash-object -t tree /dev/null) $ git diff-index --check $empty gdb/NEWS gdb/NEWS:1874: space before tab in indent. + [--basename | --dirname] ... and add the file to the clean list in gdb/contrib/check-whitespace-pre-commit.py. [ I'm not sure if NEWS has an official style. There are no settings for NEWS in .gitattributes, so the whitespace attribute defaults to trailing-space (shorthand for blank-at-eol, blank-at-eof) and space-before-tab. We could require either spaces only (tab-in-indent) in gdb/.gitattributes: ... NEWS whitespace=space-before-tab,tab-in-indent,trailing-space ... or tab style (indent-with-non-tab): ... NEWS whitespace=space-before-tab,indent-with-non-tab,trailing-space ... For tab-in-indent, we get: ... $ git diff-index --check $empty gdb/NEWS | wc -l 228 ... and for indent-with-non-tab instead: ... $ git diff-index --check $empty gdb/NEWS | wc -l 40 ... so the more common style seems to be tab style. But I'm leaving this as is for now. ]
2025-12-10[gdb] Fix whitespace in *.defTom de Vries7-12/+23
Add indent-with-non-tab for *.def in gdb*/.gitattributes. Fix whitespace in the *.def files in gdb*, and add these files to the clean list in gdb/contrib/check-whitespace-pre-commit.py. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2025-12-10[gdb] Fix whitespace in *.[ly]Tom de Vries10-160/+163
Add indent-with-non-tab for *.[ly] in gdb/.gitattributes. Fix whitespace in the *.[ly] files in gdb, and add these files to the clean list in gdb/contrib/check-whitespace-pre-commit.py. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2025-12-10[gdb] Fix whitespace in *.cTom de Vries23-27/+15
Fix whitespace in the *.c files in gdb, and add these files to the clean list in gdb/contrib/check-whitespace-pre-commit.py. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2025-12-10[gdb] Fix whitespace in *.hTom de Vries5-6/+6
Fix whitespace in the *.h files in gdb, and add these files to the clean list in gdb/contrib/check-whitespace-pre-commit.py. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2025-12-10x86: Add _bfd_elf_x86_copy_special_section_fieldsH.J. Lu4-96/+18
When Linux/x86 objcopy is used on Solaris binary, it sets EI_OSABI to ELFOSABI_SOLARIS, but it doesn't set the sh_info and sh_link fields of Solaris specific sections. Add _bfd_elf_x86_copy_special_section_fields to return false for Solaris binary to properly set the sh_info and sh_link fields of Solaris specific sections. PR binutils/33705 * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields): Removed. (elf_backend_copy_special_section_fields): Likewise. * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields): Likewise. (elf_backend_copy_special_section_fields): Likewise. * elfxx-x86.c (_bfd_elf_x86_copy_special_section_fields): New. * elfxx-x86.h (_bfd_elf_x86_copy_special_section_fields): Likewise. (elf_backend_copy_special_section_fields): Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-12-09Partly rewrite dwarf2_get_symbol_read_needsTom Tromey1-23/+29
This patch partly rewries dwarf2_get_symbol_read_needs. The goal is to simplify it and perhaps make it a little more efficient. With this patch, if an operation simply continues to the next operation in the expression, then no manipulation of ops_to_visit is needed. This avoids excess pushes and pops. Also, visited_ops is changed to be a std::vector<bool> rather than a map. Regression tested on x86-64 Fedora 41.
2025-12-09Implement local-environment commandsTom Tromey4-0/+208
A user noted that "set environment" does not affect things like "shell" or "pipe". This makes some sense, because the environment is per-inferior, and also in the general case it may be affecting a remote machine -- i.e., the settings may not be locally appropriate. This patch adds a new set of "local-environment" commands (set, show, and unset) that affect gdb's own environment. Approved-By: Andrew Burgess <aburgess@redhat.com> Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
2025-12-09Allow NULL to be passed to environment-related functionsTom Tromey1-8/+30
This changse the various environment-related helper functions to accept a NULL environment pointer. This special case means that the function should affect gdb's global environment. Approved-By: Andrew Burgess <aburgess@redhat.com> Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
2025-12-09Switch environment-related functions to accept a pointerTom Tromey1-12/+12
This changes the environment-related helper functions to accept a pointer argument rather than a reference. Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
2025-12-09Refactor environment-related commandsTom Tromey1-9/+39
This patch refactors the various environment-related commands into functions that accept gdb_environ parameter. Reviewed-by: Kévin Le Gouguec <legouguec@adacore.com>
2025-12-09Rewrite the "show environment" testTom Tromey1-6/+19
In a review early in the year: https://inbox.sourceware.org/gdb-patches/874iz3f4ek.fsf@redhat.com/ Andrew pointed out that a new test I proposed failed with read1. This test was essentially a copy of gdb.base/environ.exp. I couldn't reproduce the read1 problem, but this patch rewrites the one test there that seems like it could possibly fail in this mode. Now it uses line-by-line mode and checks for a certain environment variable appearing in the output. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-12-09gdb: remove unused includes from c-lang.{c,h}Simon Marchi3-3/+1
These includes are reported as unused by clangd. Change-Id: Ib5c655d9c96e7a612e223bd87d124f90112acc5a
2025-12-09gdb: remove unused arch-utils.h include from solib-rocm.cSimon Marchi1-1/+0
This include is reported as unused by clangd. Change-Id: I4fe6048d072d445a2133ac17887fe37ccc5e2d90
2025-12-09gdb: adjust guile 2.0 NEWS entrySimon Marchi1-1/+2
I forgot to update the previous patch based on a review comment before pushing. Change-Id: Ib357d105ba67725bfa4772f95d0b658456173be6
2025-12-09gdb: more guile 2.0 support removalSimon Marchi9-125/+9
Commit f14bbacae00d ("gdb/guile: remove support for Guile < 2.2") removed some code supporting Guile 2.0. This patch removes more bits related to Guile 2.0, and adds a NEWS entry. * Remove Guile 2.0 mention from the doc. * Remove HAVE_GUILE_MANUAL_FINALIZATION, assume it is always true. * Remove guile-2.0 from the versions automatically tried by configure. * Remove check for scm_new_smob (HAVE_SCM_NEW_SMOB), assume it is always true. * Remove hack to fill ac_cv_guild_program_name when the .pc file wouldn't specify it. Tested by rebuilding against guile-3.0 and guile-2.2. Change-Id: I2e89bcd4a4429262f4c3a1c74b275768e60f0cb0 Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org> Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2025-12-09BFD: Unify relocation error reportingMaciej W. Rozycki5-174/+103
A couple of targets use virtually the same code for error reporting in relocation processing. Merge the copies, removing small discrepancies such as a fallback call to `abort' for NDS32 targets as per PR 17512, and factor out for backends to use.
2025-12-09gdb: fix build error after forward_scope_exit changesAndrew Burgess1-4/+3
After commit: commit 43db8f70d86b2492b79f59342187b919fd58b3dd Date: Thu Oct 23 16:34:20 2025 +0100 gdbsupport: remove undefined behaviour from (forward_)scope_exit A build failure was reported[1] when using clang++. The failure looks like this: CXX aarch64-fbsd-tdep.o In file included from /tmp/src/binutils-gdb/gdb/aarch64-fbsd-tdep.c:22: In file included from /tmp/src/binutils-gdb/gdb/gdbarch.h:28: In file included from /tmp/src/binutils-gdb/gdb/infrun.h:21: In file included from /tmp/src/binutils-gdb/gdb/gdbthread.h:35: /tmp/src/binutils-gdb/gdb/../gdbsupport/forward-scope-exit.h:112:20: error: too many template arguments for class template 'forward_scope_exit_policy' 112 | = scope_exit_base<forward_scope_exit_policy<Function, | ^ 113 | function, Res, Args...>>; | ~~~~~~~~ /tmp/src/binutils-gdb/gdb/../gdbsupport/forward-scope-exit.h:82:8: note: template is declared here 81 | template<typename Function, Function *function, typename Signature> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 82 | struct forward_scope_exit_policy; | ^ The problem is that the forward_scope_exit_policy class expects 3 template arguments, but in forward-scope-exit.h we say: template<typename Function, Function *function, typename Res, typename... Args> using forward_scope_exit = scope_exit_base<forward_scope_exit_policy<Function, function, Res, Args...>>; Which passes 4 template arguments. Fix this by changing the above 'using' like too: template<typename Function, Function *function, typename Signature> using forward_scope_exit = scope_exit_base<forward_scope_exit_policy<Function, function, Signature>>; This now compiles with clang++.
2025-12-09tail recursion in _bfd_elf_link_hide_symbolAlan Modra1-5/+3
We can clear the flags first if no backend hide_symbol function tests or sets them, which is true. * elflink.c (_bfd_elf_link_hide_symbol): Clear flags before calling elf_backend_hide_symbol, to enable tail recursion.
2025-12-09gold testsuite volatile fixesAlan Modra2-3/+4
Avoid these mainline gcc complaints (C23 WG14 n2743). copy_test_relro.cc:42:5: error: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Werror=volatile] icf_test_pr21066.cc:50:55: error: ‘volatile’-qualified parameter is deprecated [-Werror=volatile] * testsuite/copy_test_relro.cc (segv): Avoid gcc warning. * testsuite/icf_test_pr21066.cc (capture_exception_of_type): Likewise.
2025-12-09bitwise operation between different enumeration typesAlan Modra1-8/+2
mips.cc:9478:50: error: bitwise operation between different enumeration types ‘elfcpp::<unnamed enum>’ and ‘elfcpp::<unnamed enum>’ is deprecated [-Werror=deprecated-enum-enum-conversion] 9478 | merged_flags &= ~(elfcpp::EF_MIPS_ARCH | elfcpp::EF_MIPS_MACH); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ * mips.h: Define all the EF_MIPS values in one enum.
2025-12-09LoongArch: Add support for the ud macro instructionLulu Cai7-10/+85
In the "ud ui5" macro, the value of ui5 must be in the range 0–31. It expands to "amswap.w $rd, $r1, $rj", where ui5 specifies the register number for $rd in the amswap.w instruction, and $rd == $rj. The test case have been adjusted to no longer report errors for illegal operands of the amswap.w instruction. gas/ * config/tc-loongarch.c (check_this_insn_before_appending): No longer check amswap.w. * testsuite/gas/loongarch/illegal-operand.l: Update. * testsuite/gas/loongarch/illegal-operand.s: Update. * testsuite/gas/loongarch/macro_ud.d: New test. * testsuite/gas/loongarch/macro_ud.s: New test. include/ * opcode/loongarch.h: Add new macro for amswap.w. opcodes/ * loongarch-opc.c: Add macro for ud.
2025-12-09lto-wrapper warning noteAlan Modra1-0/+1
Current gcc adds a note to the LTO "using serial compilation" warning. * lib/binutils-common.exp (prune_warnings_extra): Remove lto-wrapper note.
2025-12-09Automatic date update in version.inGDB Administrator1-1/+1
2025-12-09i386: Add GLIBC_ABI_GNU_TLS dependency only if usedH.J. Lu3-1/+17
Add GLIBC_ABI_GNU_TLS version dependency only if ___tls_get_addr is referenced by regular object. bfd/ PR ld/33287 PR ld/33702 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set has_tls_get_addr_call only if referenced by regular object. ld/ PR ld/33287 PR ld/33702 * testsuite/ld-i386/i386.exp: Run PR ld/33702 test. * testsuite/ld-i386/no-tls.c: New file. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-12-09Revert "Re: Add warning message to readelf for local symbols"Alan Modra1-1/+0
This reverts commit f70242a98f91b7f5ec5b375346d8bfa7f9a61c4a. Nick already applied this..
2025-12-09Re: Add warning message to readelf for local symbolsAlan Modra1-0/+1
Limit the warning to ET_REL.
2025-12-08[gdb/contrib] Add more clean files in check-whitespace-pre-commit.pyTom de Vries1-6/+1
Add gdbsupport and gdbserver as whitespace-clean in gdb/contrib/check-whitespace-pre-commit.py. Likewise for *.ac and *.m4. Also drop the ignore of configure, that's already taken care of in .gitattributes. Approved-By: Tom Tromey <tom@tromey.com>
2025-12-08[gdb/testsuite] Simplify gdb.multi/remote-with-running-inferior.expTom de Vries1-9/+10
Simplify regexps in test-case gdb.multi/remote-with-running-inferior.exp using string_to_regexp and {}. While we're at it, also break an overly long line. Tested on x86_64-linux.
2025-12-08[gdb/testsuite] Fix two typos in gdb.multi/remote-with-running-inferior.expTom de Vries1-2/+2
Fix two typos in test-case gdb.multi/remote-with-running-inferior.exp.
2025-12-08[gdb/testsuite] Fix FAIL in gdb.multi/remote-with-running-inferior.expTom de Vries1-1/+2
Occasionally, with test-case gdb.multi/remote-with-running-inferior.exp I run into: ... (gdb) continue^M Continuing.^M ^M Thread 1.1 "remote-with-run" hit Breakpoint 1.1, main () at \ remote-with-running-inferior.c:31^M 31 for (int i = 0; i < 30; ++i)^M (gdb) PASS: $exp: target_non_stop=auto: non_stop=off: \ continue to breakpoint: continue to breakpoint in breakpt bt 1^M (gdb) FAIL: $exp: target_non_stop=auto: non_stop=off: \ check inferior 1 is in breakpt ... The problem is a race between: - inferior 1 reaching main, and - gdb setting a breakpoint on main. If the breakpoint on main is set before inferior 1 reaches main, the breakpoint triggers for inferior 1, which the test-case doesn't expect. Fix this by setting the breakpoint on main only for inferior 2. Tested on x86_64-linux. PR testsuite/33621 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33621
2025-12-08readelf: Only check for out of bounds local symbols in object filesAlan Modra1-5/+5
2025-12-08Fix typo in aarch64-opc.cNick Clifton1-1/+1