aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-07-23libctf: link: rejig lazy opening to not need weak symbolsusers/nalcock/try-unweaken-libctfNick Alcock1-61/+27
The ctf_link_add_ctf API function has a 'lazy opening' feature whereby, if you pass in the file but not a CTF archive, the archive is opened as late as possible during links. This is valuable mostly in cu-mapped links (a feature not accessible via GNU ld), where it ensures that, rather than eventually needing memory for the original link inputs, the smushed-together cu-mapped intermediate outputs, *and* the final output, we only need enough memory for the smushed- together outputs, the final output, and one input, since the inputs can be closed immediately after they are smushed together. (In GNU ld, the feature is useless because it loads all sections into memory anyway.) The lazy-opening feature uses libctf's ctf_open function, which uses BFD: so it is not available in libctf-nobfd -- except that I thought I had a cunning trick, and used a weak symbol so that if you linked libctf-nobfd into your program and then also linked in bfd, the feature stayed enabled. This is silly -- if your program is licensed such that you can link in BFD, you can just link in libctf.so and not bother with libctf-nobfd.so in the first place. Worse, the weak symbol usage broke MacOS builds, since MacOS's system compiler uses a different means of introducing weak symbols. We could test for and use it, but this is the only place in libctf to use weak symbols at all, and the feature of lazy-opening with libctf-nobfd is so marginal we might as well drop it: it's almost certain there are zero users, certainly fewer users than users of MacOS with the system compiler. While we're at it, simplify things by deleting the never-implemented feature (not exposed in the API) to allow linking together raw buffers of CTF data. If we need it we can bring it back, but all it's doing right now is complicating the code to no end at all. libctf/ * ctf-link.c (ctf_open): Delete weak pragma. (ctf_link_add): Fuse with... (ctf_link_add_ctf): ... this function. Drop BUF, N args and corresponding unimplemented feature warnings. Only check NOBFD to see whether lazy loading is available, not PIC as well. (ctf_link_lazy_open): Likewise.
2025-07-23libctf: don't run tests requiring deduplicating linker unless one is in useNick Alcock5-1/+67
Before now, we were relying on gcc -B to repoint GCC at our freshly-built linker, and assuming we could use this to run tests that do linker dedup. This is, alas, not reliable (building --with-ld=/an/absolute/path bypasses -B searches for the linker), and we would like the libctf tests in particular to not fail if the compiler uses a linker that cannot deduplicate (simply skipping such tests). Add a new testsuite function that tries to link one of the lookup tests' testcases (which is known to produce conflicting types, i.e. a dict with per-translation-unit children) and then does an objdump and greps it for signs of the per-translation-unit children. If there are none, the linker probably just concatenated the sections: i.e., it is not a linker that can deduplicate CTF. libctf/ PR libctf/33162 * testsuite/config/default.exp (objdump): Introduce. (OBJDUMPFLAGS): Likewise. * testsuite/lib/ctf-lib.exp (check_ctf_linker_dedup): New. * testsuite/libctf-lookup/lookup.exp: Use it. * testsuite/libctf-regression/libctf-repeat-cu.exp: Likewise. * testsuite/libctf-regression/regression.exp: Likewise.
2025-07-23libctf: exclude always-emitted Solaris symbols from the symtypetabRainer Orth1-0/+6
If we're skipping _BEGIN_ and _END_ we should certainly skip all the other ABI-required always-emitted symbols given in ld/emultempl/solaris2*em as well. (This fixes a couple of diagnostics tests, but that's just because the tests are quite sensitive to CTF section sizes, and introducing any symtypetab entries for those tests perturbs those.) Some of these are usually STT_NOTYPE, but not always: if programs already emitted the symbol they might end up with any type, in particular STT_OBJECT, and appear in the symtypetabs. [nca: added commit log, added more symbols] libctf/ PR libctf/33162 * ctf-serialize.c (ctf_symtab_skippable): Skip more always-emitted Solaris symbols.
2025-07-23libctf: get libctf-nobfd.ver from the right place with Solaris ldNick Alcock2-2/+2
We generate de-commented version scripts for Solaris ld (whose -z gnu-version-script linker option does not support comments), but after we switched to generating libctf-nobfd.ver itself, we failed to adjust this code to pick it up from the new location. libctf/ PR libctf/33161 * configure.ac: Fix libctf-nobfd.ver path on Solaris. * configure: Regenerated.
2025-07-23libctf: do not use mmap on Solaris 11Rainer Orth2-0/+16
Writable mmaps and read are inconsistent with each other on Solaris 11.4, which breaks archive writing. Simply assert that Solaris 2.11 doesn't have mmap, falling back to read(): the archive format is being bumped shortly, to one with completely different writeout code, so this workaround need not stay for long. [nca: added commit log] libctf/ PR libctf/29292 * configure.ac: Turn off mmap on Solaris 2.11. * configure: Regenerated.
2025-07-23gas: sframe: fix PR gas/33170Indu Bhagat4-4/+71
SFrame generation code assumes that since DW_CFA_restore means restoration of the state of the register to the one at the beginning of the function, there must be a state to restore to (hence the gas_assert (cie_fre)). This assumption needs adjustment. DW_CFA_restore may be present in the very beginning of a (e.g., cold) function, with no initialized state for SFrame functions to restore to. gas/ PR gas/33170 * gas/gen-sframe.c (sframe_xlate_do_restore): Use current FRE if CIE FRE is not yet setup. gas/testsuite/ PR gas/33170 * gas/cfi-sframe/cfi-sframe.exp: New test. * gas/cfi-sframe/cfi-sframe-x86_64-pr33170.d: New test. * gas/cfi-sframe/cfi-sframe-x86_64-pr33170.s: New test.
2025-07-23Automatic date update in version.inGDB Administrator1-1/+1
2025-07-22[gdb/testsuite] Modernize gdb.base/command-line-input.expTom de Vries1-10/+20
Modernize test-case gdb.base/command-line-input.exp using clean_restart, multi_line and string_to_regexp. Tested on x86_64-linux. Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-07-22[gdb/cli] Clear line buffer on ^CTom de Vries2-0/+31
Gdb has the ability to gather input over several lines [1], for instance this: ... (gdb) print 1 $1 = 1 (gdb) ... can also be typed as: ... (gdb) print\ 1 $2 = 1 (gdb) ... Furthermore, if we type a command but change our mind, we can abort using ^C and start over using a fresh gdb prompt [2]: ... (gdb) print 1❌️ Quit (gdb) echo 1\n 1 (gdb) ... Now say we type a multi-line command but abort it, we get: ... (gdb) print\ 1❌️ Quit (gdb) echo 1\n ❌️ Undefined command: "printecho". Try "help". (gdb) ... Using "set trace-commands on", we can see what happened: ... +printecho 1\n .. Gdb has prepended the first line of the cancelled multi-line command to the following command. Fix this by clearing current_ui->line_buffer on catching a gdb_exception in start_event_loop. Tested on x86_64-linux. Approved-By: Andrew Burgess <aburgess@redhat.com> PR cli/33063 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33063 [1] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Output.html [2] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Quitting-GDB.html
2025-07-22gdb: Remove redundant parameter for filename completionGuinevere Larsen3-9/+8
As I was working on an unrelated patch, I noticed that all calls to make_source_files_completion_list had both parameters of the function call being the same pointer. I think we can remove that redundancy and make that call with just one parameter. Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-07-22gdb/solib-svr4: fix indentSimon Marchi1-2/+2
Change-Id: I63f78f359f55ec15fb3296a1a9ce28c9d01d663b
2025-07-22gdb: use skip_spaces in info_linker_namespace_commandSimon Marchi1-3/+1
Change-Id: I02c7daed3740e319ee27d3512a2b941f666b103b Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-07-22gdb: fix formatting in solib.cSimon Marchi1-2/+2
I found these two small nits while working in this file. Change-Id: Ibdaa57262f3fe363b039fbad746e285fa7b52f8b Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-07-22Updated translations for various sub-directoriesNick Clifton7-13025/+15433
2025-07-22Remove steps for adding .dirstamp when creating pre-release tarballNick Clifton1-11/+0
2025-07-22ld: Rename a file on Windows fails if target already existsTorbjörn SVENSSON1-2/+16
To rename a file on Windows, the target name cannot exist. Removing file prior to renaming ensures this is handled. To remove a file on Windows, the file cannot be open. Closing the bfd handle ensures this is handled. Moved call to free on isympp / osympp to after bfd is closed to align with comment earlier in the cmdline_add_object_only_section function. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2025-07-22Fix failing test: i386-avx-reverseShiven Kashyap2-3/+3
Running the standalone test `gdb.reverse` with the target board configuration `unix/-fPIE/-pie` leads to the following failure: ''' FAIL: gdb.reverse/i386-avx-reverse.exp: verify ymm15 before vbroadcastsd ''' This happens because the test expects values stored in `dyn_buf0`, but instead (in the test source) the address of the buffer itself got broadcast to xmm15 (and thus to ymm15). This happened because the pointer to the start of `dyn_buf0` wasn't dereferenced (see 'vpbroadcast_test' in 'i386-avx-reverse.c'): ''' asm volatile ("vbroadcastss %0, %%xmm15": : "m" (dyn_buf0)); ^ ''' and this consequently lead to the test failing for the next instruction (`vbroadcastsd`), which depended on the correct value being broadcast to the register. Also, updated the corresponding expected output (gdb.reverse/i386-avx-reverse.exp) to match. Tested on x86-64 Linux. Signed-off-by: Shiven Kashyap <shivenkashyap24@gmail.com> Approved-By: Guinevere Larsen <guinevere@redhat.com>
2025-07-22RISC-V: Don't allocate dynamic relocation if it's section was discardedNelson Chu2-0/+47
2025-07-22RISC-V: Fix the assert fail when linking discarded sections under -pie for gotNelson Chu7-40/+109
Considering the following case, % cat tmp.s .option pic .text .global _start _start: nop .section .discard.s, "ax" la x1, _start % cat tmp.ld OUTPUT_ARCH(riscv) ENTRY(_start) SECTIONS { /DISCARD/ : { *(.discard.*) } . = 0x10000; .text : { *(.text) } . = 0x20000; .got : { *(.got) *(.got.plt)} . = 0x30000; .data : { *(.data) *(.data.*) } } % riscv64-unknown-linux-gnu-as tmp.s -o tmp.o % riscv64-unknown-linux-gnu-ld -pie -Ttmp.ld tmp.o riscv64-unknown-linux-gnu-ld: BFD (GNU Binutils) 2.44.50.20250624 assertion fail binutils-gdb/bfd/elfnn-riscv.c:3638 This happens when pie and the input sections, which refers to the global symbol by got, are all discarded. Since referenced sections are all discarded, we won't go into relocate_section for those sections, the got entry also won't be initialized. Therefore, we will get assert fail when adding the RELATIVE reloc in the finish_dynamic_symbol. After seeing other target codes, there are two root causes as follows, 1. risc-v may call bfd_elf_link_record_dynamic_symbol in the allocate_dynrelocs for not only undefweak symbols. 2. risc-v is missing the code to add RELATIVE to R_RISCV_GOT entries in the relocate_section if a symbol is not dynamic and is not undefined weak under pic and pie. If we call bfd_elf_link_record_dynamic_symbol, then the global symbol will be forced to dynamic, so the h->dynindx will forced to be a number rather than -1, even it should be -1. Once h->dynindx != -1 and pic/pie, it will go into finish_dynamic_symbol and insert RELATIVE/64 relocs for the got entry; For the above case there are two issues, 1. The global symbol _start is forced to be dynamic in the allocate_dynrelocs. when pie and all the referenced section are discarded, it won't go into relocate_section to initialize the got entry, so it will cause assert fail when adding RELATIVE reloc in the finish_dynamic_symbol. The assert fail represents another problem - if we don't initialize the got entry in the relocate_section under pie, which means we don't need to go into the finish_dynamic_symbol and don't need a RELATIVE reloc for the got entry, it should be NONE reloc. 2. Without linking any discarded section, it originally forces every RELATIVE relocs added for every got by the finish_dynamic_symbol. Even The final result looks correct under pie (genearte a RELATIVE reloc for got entry), not sure if it may cause other problems for some special cases, excpet the above one. Therefore, this patch try to fix the above assert fail, and also clarify the behavior of the allocate_dynrelocs which should only call bfd_elf_link_record_dynamic_symbol for undefweak symbols, and add the missing code to generate RELATIVE reloc to R_RISCV_GOT entries in the relocate_section if a symbol is not dynamic and is not undefined weak under pic and pie. Passed the gcc/binutils regressions of riscv-gnu-toolchain at least.
2025-07-22RISC-V: Indent and reorder backend define functions for bfd/elfnn-riscv.cNelson Chu1-17/+24
2025-07-22Automatic date update in version.inGDB Administrator1-1/+1
2025-07-21gdb: remove unused includesSimon Marchi6-10/+0
Remove a bunch of includes reported as unused by clangd. Change-Id: I3f05f98a298036fadf1acce4ddc198405ec056ee
2025-07-21gdb/solib-svr4: remove an unnecessary static castSimon Marchi1-5/+2
The type is already lm_info_svr4. Change-Id: Id681eb1685462610b202c76147739ac885555f6b
2025-07-21aarch64: Use an enum to refer to indices in the opcode tableRichard Earnshaw7-11646/+13651
The indices into the auto-generated tables for opcodes are relatively unstable. Adding a new opcode can permute the code significantly. But most of this churn is down to changes in the index values. To minimize this use enumerated constants. While the index values change, the enumeration names will need to do so far less often, so most of the changes in the generated code become localized to the addition (occasionally removal) of opcodes. This change also makes the state-change comments unnecessary. The enumeration names contain the same information (and more), so these are simply deleted. The enumeration values are placed in a new header file, aarch64-tbl-2.h, so aarch64-gen gains a new option to build this header and the Makefile rules are adjusted accordingly.
2025-07-21aarch64: use an enumeration for operand indices.Richard Earnshaw3-675/+675
The generated aarch64 operand tables use index values into an array. But if the table of operands is modified by inserting a new operand into the middle of the table, *all* the index values can change, leading to a lot of churn in the generated output. include/opcode/aarch64.h already provides an enumeration for the operands, so make use of that instead of printing out the raw index values.
2025-07-21aarch64: Fix operand name MOPS_WB_Rd -> MOPS_WB_RnRichard Earnshaw2-2/+2
This field was misnamed in aarch64_opcode_table. It previously didn't matter too much as the name field only appeared in dumps. But it doesn't match the enum in include/opcode/aarch64.h and we will shortly start to rely on that.
2025-07-21aarch64: minor code cleanups to aarch64-gen.cRichard Earnshaw4-36/+42
Fix some overly-long lines.
2025-07-21gdb/solib-svr4: remove unused svr4_solib_ops method declarationsSimon Marchi1-8/+0
These method declarations are unused, remove them. I guess that when writing a previous patch, changed some free functions to be methods, then changed my mind, and forgot to remove the declarations. Change-Id: I7452bb773af0f32c4aae2fe6a4fc663ec65c3f15
2025-07-21Remove NaCl/arm target supportH.J. Lu246-1109/+251
NaCl has been deprecated: https://developer.chrome.com/docs/native-client/migration/ It is now in the process of being removed from llvm: https://github.com/llvm/llvm-project/pull/133661 Remove NaCl/arm target support from bfd, binutils, gas and ld. bfd/ * Makefile.am (BFD32_BACKENDS): Remove elf-nacl.lo. (BFD32_BACKENDS_CFILES): Remove elf-nacl.c. (SOURCE_HFILES): Remove elf-nacl.h. * Makefile.in: Regenerated. * config.bfd: Add *-*-nacl* to obsolete targets. Remove *-*-nacl* targets. * configure.ac: Remove nacl target vectors. * elf-bfd.h (elf_target_os): Remove is_nacl. * elf-nacl.c: Removed. * elf-nacl.h: Likewise. * elf32-arm.c: Don't include "elf-nacl.h". (elf32_arm_nacl_plt0_entry): Removed. (elf32_arm_nacl_plt_entry): Likewise. (elf32_arm_stub_long_branch_arm_nacl): Likewise. (elf32_arm_stub_long_branch_arm_nacl_pic): Likewise. (arm_movw_immediate): Likewise. (arm_movt_immediate): Likewise. (arm_nacl_put_plt0): Likewise. (elf32_arm_nacl_link_hash_table_create): Likewise. (elf32_arm_nacl_modify_segment_map): Likewise. (elf32_arm_nacl_final_write_processing): Likewise. (elf32_arm_nacl_plt_sym_val): Likewise. (elf32_arm_stub_cmse_branch_thumb_only): Remove long_branch_arm_nacl and long_branch_arm_nacl_pic entries. (arm_type_of_stub): Updated. (elf32_arm_create_or_find_stub_sec): Likewise. (arm_stub_required_alignment): Likewise. (elf32_arm_allocate_plt_entry): Likewise. (elf32_arm_populate_plt_entry): Likewise. (elf32_arm_finish_dynamic_sections): Likewise. (elf32_arm_output_plt_map_1): Likewise. (elf32_arm_output_arch_local_syms): Likewise. Remove elf32_arm_nacl_bed. * targets.c: Remove NaCl target vectors. * bfd-in2.h: Regenerated. * configure: Likewise. * po/SRC-POTFILES.in: Likewise. binutils/ * NEWS: Mention NaCl target support removal. * testsuite/lib/binutils-common.exp: Remove NaCl target support. gas/ * NEWS: Mention NaCl target support removal. * configure.tgt: Likewise. * config/tc-arm.c: Remove NaCl target support. * testsuite/gas/arm/any-armv8m.d: Likewise. * testsuite/gas/arm/any-cmse-main.d: Likewise. * testsuite/gas/arm/any-cmse.d: Likewise. * testsuite/gas/arm/any-idiv.d: Likewise. * testsuite/gas/arm/arch4t-eabi.d: Likewise. * testsuite/gas/arm/arch4t.d: Likewise. * testsuite/gas/arm/armv8m.base-idiv.d: Likewise. * testsuite/gas/arm/armv9-a_arch.d: Likewise. * testsuite/gas/arm/attr-abi-hardfp-use-0.d: Likewise. * testsuite/gas/arm/attr-abi-hardfp-use-1.d: Likewise. * testsuite/gas/arm/attr-abi-hardfp-use-2.d: Likewise. * testsuite/gas/arm/attr-abi-hardfp-use-3.d: Likewise. * testsuite/gas/arm/attr-any-armv4t.d: Likewise. * testsuite/gas/arm/attr-any-thumbv6.d: Likewise. * testsuite/gas/arm/attr-arch-assumption.d: Likewise. * testsuite/gas/arm/attr-cpu-directive.d: Likewise. * testsuite/gas/arm/attr-default.d: Likewise. * testsuite/gas/arm/attr-empty-string.d: Likewise. * testsuite/gas/arm/attr-ext-fpv5-d16.d: Likewise. * testsuite/gas/arm/attr-ext-fpv5.d: Likewise. * testsuite/gas/arm/attr-ext-idiv.d: Likewise. * testsuite/gas/arm/attr-ext-mp.d: Likewise. * testsuite/gas/arm/attr-ext-neon-fp16.d: Likewise. * testsuite/gas/arm/attr-ext-neon-vfpv3.d: Likewise. * testsuite/gas/arm/attr-ext-neon-vfpv4.d: Likewise. * testsuite/gas/arm/attr-ext-sec.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv3-d16-fp16.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv3-d16.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv3-fp16.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv3.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv3xd-fp.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv3xd.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv4-d16.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv4-sp-d16.d: Likewise. * testsuite/gas/arm/attr-ext-vfpv4.d: Likewise. * testsuite/gas/arm/attr-march-all.d: Likewise. * testsuite/gas/arm/attr-march-armv1.d: Likewise. * testsuite/gas/arm/attr-march-armv2.d: Likewise. * testsuite/gas/arm/attr-march-armv2a.d: Likewise. * testsuite/gas/arm/attr-march-armv2s.d: Likewise. * testsuite/gas/arm/attr-march-armv3.d: Likewise. * testsuite/gas/arm/attr-march-armv3m.d: Likewise. * testsuite/gas/arm/attr-march-armv4.d: Likewise. * testsuite/gas/arm/attr-march-armv4t.d: Likewise. * testsuite/gas/arm/attr-march-armv4txm.d: Likewise. * testsuite/gas/arm/attr-march-armv4xm.d: Likewise. * testsuite/gas/arm/attr-march-armv5.d: Likewise. * testsuite/gas/arm/attr-march-armv5t.d: Likewise. * testsuite/gas/arm/attr-march-armv5te.d: Likewise. * testsuite/gas/arm/attr-march-armv5tej.d: Likewise. * testsuite/gas/arm/attr-march-armv5texp.d: Likewise. * testsuite/gas/arm/attr-march-armv5txm.d: Likewise. * testsuite/gas/arm/attr-march-armv6-m+os.d: Likewise. * testsuite/gas/arm/attr-march-armv6-m.d: Likewise. * testsuite/gas/arm/attr-march-armv6.d: Likewise. * testsuite/gas/arm/attr-march-armv6j.d: Likewise. * testsuite/gas/arm/attr-march-armv6k+sec.d: Likewise. * testsuite/gas/arm/attr-march-armv6k.d: Likewise. * testsuite/gas/arm/attr-march-armv6kt2.d: Likewise. * testsuite/gas/arm/attr-march-armv6kz.d: Likewise. * testsuite/gas/arm/attr-march-armv6kzt2.d: Likewise. * testsuite/gas/arm/attr-march-armv6s-m.d: Likewise. * testsuite/gas/arm/attr-march-armv6t2.d: Likewise. * testsuite/gas/arm/attr-march-armv6z.d: Likewise. * testsuite/gas/arm/attr-march-armv6zk.d: Likewise. * testsuite/gas/arm/attr-march-armv6zkt2.d: Likewise. * testsuite/gas/arm/attr-march-armv6zt2.d: Likewise. * testsuite/gas/arm/attr-march-armv7-a+idiv.d: Likewise. * testsuite/gas/arm/attr-march-armv7-a+mp.d: Likewise. * testsuite/gas/arm/attr-march-armv7-a+sec+virt.d: Likewise. * testsuite/gas/arm/attr-march-armv7-a+sec.d: Likewise. * testsuite/gas/arm/attr-march-armv7-a+virt.d: Likewise. * testsuite/gas/arm/attr-march-armv7-a.d: Likewise. * testsuite/gas/arm/attr-march-armv7-m.d: Likewise. * testsuite/gas/arm/attr-march-armv7-r+mp.d: Likewise. * testsuite/gas/arm/attr-march-armv7-r.d: Likewise. * testsuite/gas/arm/attr-march-armv7.d: Likewise. * testsuite/gas/arm/attr-march-armv7a.d: Likewise. * testsuite/gas/arm/attr-march-armv7em.d: Likewise. * testsuite/gas/arm/attr-march-armv7m.d: Likewise. * testsuite/gas/arm/attr-march-armv7r.d: Likewise. * testsuite/gas/arm/attr-march-armv7ve.d: Likewise. * testsuite/gas/arm/attr-march-armv8-a+crypto.d: Likewise. * testsuite/gas/arm/attr-march-armv8-a+fp.d: Likewise. * testsuite/gas/arm/attr-march-armv8-a+rdma.d: Likewise. * testsuite/gas/arm/attr-march-armv8-a+simd.d: Likewise. * testsuite/gas/arm/attr-march-armv8-a.d: Likewise. * testsuite/gas/arm/attr-march-armv8-r+crypto.d: Likewise. * testsuite/gas/arm/attr-march-armv8-r+fp.d: Likewise. * testsuite/gas/arm/attr-march-armv8-r+simd.d: Likewise. * testsuite/gas/arm/attr-march-armv8-r.d: Likewise. * testsuite/gas/arm/attr-march-armv8_1-a+simd.d: Likewise. * testsuite/gas/arm/attr-march-armv8_1-m.main.d: Likewise. * testsuite/gas/arm/attr-march-armv8_4-a.d: Likewise. * testsuite/gas/arm/attr-march-armv8_5-a.d: Likewise. * testsuite/gas/arm/attr-march-armv8_6-a.d: Likewise. * testsuite/gas/arm/attr-march-armv8_7-a.d: Likewise. * testsuite/gas/arm/attr-march-armv8_8-a.d: Likewise. * testsuite/gas/arm/attr-march-armv8_9-a.d: Likewise. * testsuite/gas/arm/attr-march-armv9_1-a.d: Likewise. * testsuite/gas/arm/attr-march-armv9_2-a.d: Likewise. * testsuite/gas/arm/attr-march-armv9_3-a.d: Likewise. * testsuite/gas/arm/attr-march-armv9_4-a.d: Likewise. * testsuite/gas/arm/attr-march-armv9_5-a.d: Likewise. * testsuite/gas/arm/attr-march-armv8m.base.d: Likewise. * testsuite/gas/arm/attr-march-armv8m.main.d: Likewise. * testsuite/gas/arm/attr-march-armv8m.main.dsp.d: Likewise. * testsuite/gas/arm/attr-march-iwmmxt.d: Likewise. * testsuite/gas/arm/attr-march-iwmmxt2.d: Likewise. * testsuite/gas/arm/attr-march-xscale.d: Likewise. * testsuite/gas/arm/attr-mcpu.d: Likewise. * testsuite/gas/arm/attr-mfpu-arm1020e.d: Likewise. * testsuite/gas/arm/attr-mfpu-arm1020t.d: Likewise. * testsuite/gas/arm/attr-mfpu-arm1136jf-s.d: Likewise. * testsuite/gas/arm/attr-mfpu-arm1136jfs.d: Likewise. * testsuite/gas/arm/attr-mfpu-neon-fp16.d: Likewise. * testsuite/gas/arm/attr-mfpu-neon.d: Likewise. * testsuite/gas/arm/attr-mfpu-softvfp+vfp.d: Likewise. * testsuite/gas/arm/attr-mfpu-softvfp.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfp.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfp10-r0.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfp10.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfp3.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfp9.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfpv2.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfpv3-d16.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfpv3.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfpv4-d16.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfpv4.d: Likewise. * testsuite/gas/arm/attr-mfpu-vfpxd.d: Likewise. * testsuite/gas/arm/attr-names.d: Likewise. * testsuite/gas/arm/attr-non-null-terminated-string.d: Likewise. * testsuite/gas/arm/attr-order.d: Likewise. * testsuite/gas/arm/attr-override-cpu-directive.d: Likewise. * testsuite/gas/arm/attr-override-mcpu.d: Likewise. * testsuite/gas/arm/bl-local-2.d: Likewise. * testsuite/gas/arm/bl-local-v4t.d: Likewise. * testsuite/gas/arm/blx-local.d: Likewise. * testsuite/gas/arm/branch-reloc.d: Likewise. * testsuite/gas/arm/directives.d: Likewise. * testsuite/gas/arm/got_prel.d: Likewise. * testsuite/gas/arm/mapdir.d: Likewise. * testsuite/gas/arm/mapmisc.d: Likewise. * testsuite/gas/arm/mapsecs.d: Likewise. * testsuite/gas/arm/mapshort-eabi.d: Likewise. * testsuite/gas/arm/mov-highregs-any.d: Likewise. * testsuite/gas/arm/mov-lowregs-any.d: Likewise. * testsuite/gas/arm/note-march-armv2.d: Likewise. * testsuite/gas/arm/note-march-armv2a.d: Likewise. * testsuite/gas/arm/note-march-armv3.d: Likewise. * testsuite/gas/arm/note-march-armv3m.d: Likewise. * testsuite/gas/arm/note-march-armv4.d: Likewise. * testsuite/gas/arm/note-march-armv4t.d: Likewise. * testsuite/gas/arm/note-march-armv5.d: Likewise. * testsuite/gas/arm/note-march-armv5t.d: Likewise. * testsuite/gas/arm/note-march-armv5te.d: Likewise. * testsuite/gas/arm/note-march-iwmmxt.d: Likewise. * testsuite/gas/arm/note-march-iwmmxt2.d: Likewise. * testsuite/gas/arm/note-march-xscale.d: Likewise. * testsuite/gas/arm/pr12198-1.d: Likewise. * testsuite/gas/arm/pr12198-2.d: Likewise. * testsuite/gas/arm/thumb-eabi.d: Likewise. * testsuite/gas/arm/thumb.d: Likewise. * testsuite/gas/arm/thumbrel.d: Likewise. * config/te-nacl.h: Removed. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Remove earmelf_nacl.c and and earmelfb_nacl.c. Remove NaCl dep files. * NEWS: Mention NaCl target support removal. * configure.tgt: Remove NaCl target support. * Makefile.in: Regenerated. * configure: Likewise. * po/BLD-POTFILES.in: Likewise. * emulparams/armelf_nacl.sh: Removed. * emulparams/armelfb_nacl.sh: Likewise. * emulparams/elf_nacl.sh: Likewise. * testsuite/ld-arm/farcall-arm-nacl-pic.d: Likewise. * testsuite/ld-arm/farcall-arm-nacl.d: Likewise. * testsuite/ld-arm/farcall-data-nacl.d: Likewise. * testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d: Adjusted. * testsuite/ld-arm/arm-elf.exp: Remove NaCl target support. * testsuite/ld-arm/cortex-a8-far.d: Likewise. * testsuite/ld-arm/non-contiguous-arm3.d: Likewise. * testsuite/ld-arm/non-contiguous-arm6.d: Likewise. * testsuite/ld-elf/binutils.exp: Likewise. * testsuite/ld-elf/build-id.exp: Likewise. * testsuite/ld-elf/ehdr_start-missing.d: Likewise. * testsuite/ld-elf/ehdr_start-shared.d: Likewise. * testsuite/ld-elf/ehdr_start-userdef.d: Likewise. * testsuite/ld-elf/ehdr_start-weak.d: Likewise. * testsuite/ld-elf/ehdr_start.d: Likewise. * testsuite/ld-elf/elf.exp: Likewise. * testsuite/ld-elf/export-class.exp: Likewise. * testsuite/ld-elf/fatal-warnings-1a.d: Likewise. * testsuite/ld-elf/fatal-warnings-1b.d: Likewise. * testsuite/ld-elf/orphan-region.d: Likewise. * testsuite/ld-elf/package-note.exp: Likewise. * testsuite/ld-elf/pr16322.d: Likewise. * testsuite/ld-elf/pr16498a.d: Likewise. * testsuite/ld-elf/pr16498b.d: Likewise. * testsuite/ld-elf/pr19162.d: Likewise. * testsuite/ld-elf/pr22269a.d: Likewise. * testsuite/ld-elf/pr22269b.d: Likewise. * testsuite/ld-elf/pr22393-1a.d: Likewise. * testsuite/ld-elf/pr22393-1b.d: Likewise. * testsuite/ld-elf/pr22393-1c.d: Likewise. * testsuite/ld-elf/pr22393-1d.d: Likewise. * testsuite/ld-elf/pr22393-1e.d: Likewise. * testsuite/ld-elf/pr22393-1f.d: Likewise. * testsuite/ld-elf/pr22393-2a.rd: Likewise. * testsuite/ld-elf/pr22393-2b.rd: Likewise. * testsuite/ld-elf/pr23900-1-32.rd: Likewise. * testsuite/ld-elf/pr23900-1-64.rd: Likewise. * testsuite/ld-elf/pr23900-1.d: Likewise. * testsuite/ld-elf/pr23900-2a.d: Likewise. * testsuite/ld-elf/pr23900-2b.d: Likewise. * testsuite/ld-elf/pr30508.d: Likewise. * testsuite/ld-elf/pr30907-1.d: Likewise. * testsuite/ld-elf/pr30907-2.d: Likewise. * testsuite/ld-elf/pr32341.d: Likewise. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-elf/tls.exp: Likewise. * testsuite/ld-elf/tls_common.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-ifunc/binutils.exp: Likewise. * testsuite/ld-pie/pie.exp: Likewise. * testsuite/ld-plugin/lto-binutils.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-scripts/rgn-at3.d: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-size/size.exp: Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-21gold: Remove NaCl target supportH.J. Lu10-1311/+20
NaCl has been deprecated: https://developer.chrome.com/docs/native-client/migration/ It is now in the process of being removed from llvm: https://github.com/llvm/llvm-project/pull/133661 Remove NaCl target support from gold. * Makefile.am (CCFILES): Remove nacl.cc. (HFILES): Remove nacl.h. * Makefile.in: Regenerated. * aarch64.cc: Don't include nacl.h. * arm.cc: Don't include nacl.h. (Target_arm_nacl): Removed. (Output_data_plt_arm_nacl): Likewise. (target_selector_arm): Replace Target_arm_nacl with Target_selector_arm. * i386.cc: Don't include nacl.h. (Output_data_plt_i386_nacl): Removed. (Target_i386_nacl): Likewise. (target_selector_i386): Replace Target_selector_i386_nacl with Target_selector_i386. * mips.cc: Don't include nacl.h. (Target_mips_nacl): Removed. (Target_selector_mips_nacl): Likewise. (target_selector_mips32): Replace Target_selector_mips_nacl with Target_selector_mips. (target_selector_mips32el): Likewise. (target_selector_mips64): Likewise. (target_selector_mips64el): Likewise. * nacl.cc: Removed. * nacl.h: Likewise. * x86_64.cc: Don't include nacl.h. (Output_data_plt_x86_64_nacl): Removed. (Target_x86_64_nacl): Likewise. (target_selector_x86_64): Replace Target_x86_64_nacl with Target_selector_x86_64. (target_selector_x32): Likewise. * po/POTFILES.in: Regenerated. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-21Automatic date update in version.inGDB Administrator1-1/+1
2025-07-20Automatic date update in version.inGDB Administrator1-1/+1
2025-07-19gprofng: do not skip weak symbolsDmitrii Bordukov1-1/+1
PR gprofng/33151 gprofng ignores functions that are compiled as weak symbols. This heavily affects C++ class methods that are always compiled by g++ and clang++ as weak symbols. In this case 'gprofng display text' just displays <static>@ADDRESS(<FILENAME>) instead of proper method name. The bug has been introduced in the commit 470a0288a818.
2025-07-19[gdb/cli] Document \001 and \002 usage for set promptTom de Vries1-0/+10
PR cli/28887 reports the following problem when using a custom prompt. First, we set up the custom prompt (with ^ marking the position of the blinking cursor on the line above): ... $ gdb -q -ex "set prompt \033[31mgdb$ \033[0m" gdb$ ^ ... Then we type some string, and enter it into the command history: ... gdb$ some long command ❌️ Undefined command: "some". Try "help". gdb$ ^ ... We use C-p to fetch the previous command: ... gdb$ some long command ^ ... Sofar, so good. Finally, we use C-a which should move the cursor to just after the prompt, but instead we get: ... gdb$ some long command ^ ... This is fixed by using \001 and \002: ... (gdb) set prompt \001\033[31m\002gdb$ \001\033[0m\002 ... aka as RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE [1]. Add an example to the documentation showing the use of these markers. The added example is the equivalent of the "\[\e[0;34m\](gdb)\[\e[0m\]" example documented at gdb.prompt.substitute_string that can be used with "set extended-prompt". While working on this, I noticed that "show prompt" doesn't show back the original string, using '\e' instead of '\033': ... gdb$ show prompt Gdb's prompt is "\001\e[31m\002gdb$ \001\e[0m\002". ... and that the shown string can't be used as an argument to "set prompt": ... gdb$ set prompt \001\e[31m\002gdb$ \001\e[0m\002 e[31mgdb$ e[0m ... I've filed this as PR cli/33184. Approved-By: Eli Zaretskii <eliz@gnu.org> [1] https://tiswww.case.edu/php/chet/readline/readline.html
2025-07-19[gdb/testsuite] Restructure gdb.base/backtrace-through-cu-nodebug.expTom de Vries1-16/+27
I noticed that the test names in test-case gdb.base/backtrace-through-cu-nodebug.exp are a bit inconsistent: ... PASS: $exp: no-cfi: maint frame-unwinder disable ARCH PASS: $exp: verify no-filters unwind fail without CFI PASS: $exp: maint flush register-cache PASS: $exp: verify unwind fail without CFI PASS: $exp: cfi: maint frame-unwinder disable ARCH PASS: $exp: Verify unwinding works based only on CFI information ... There's both a no-cfi prefix, and "without CFI". Fix this by using proc_with_prefix, getting us a consistent prefix: ... PASS: $exp: no-cfi: maint frame-unwinder disable ARCH PASS: $exp: no-cfi: verify no-filters unwind fail PASS: $exp: no-cfi: maint flush register-cache PASS: $exp: no-cfi: verify unwind fail PASS: $exp: cfi: maint frame-unwinder disable ARCH PASS: $exp: cfi: Verify unwinding works ... While we're at it, use multi_line to make a regexp more readable. Tested on aarch64-linux. Reviewed-By: Keith Seitz <keiths@redhat.com>
2025-07-19[gdb/testsuite] Fix gdb.base/backtrace-through-cu-nodebug.exp without python ↵Tom de Vries1-3/+25
support With a gdb build without python support, and test-case gdb.base/backtrace-through-cu-nodebug.exp I run into: ... (gdb) bt^M Required frame unwinder may have been disabled, \ see 'maint info frame-unwinders'^M (gdb) FAIL: $exp: verify unwind fail without CFI ... With a gdb build with python support we have instead: ... (gdb) bt^M Python Exception <class 'gdb.error'>: \ Required frame unwinder may have been disabled, \ see 'maint info frame-unwinders'^M (gdb) PASS: $exp: verify unwind fail without CFI ... but if I change the "bt" into "bt -no-filters" I get the same FAIL and corresponding output. So there are two scenarios here. In the first: - the bt command is called - frame #0 is printed - trying to get the next frame fails and an error is thrown, aborting the backtrace - the error is caught and printed In the second: - the bt command is called - the frame filter is applied - doing so triggers the same error, which is caught and printed by gdbpy_apply_frame_filter, returning EXT_LANG_BT_NO_FILTERS - frame #0 is printed - getting the next frame fails, and the backtrace stops It seems worthwhile to exercise both scenarios if possible, so add a "bt -no-filters" test. Fix the FAIL by updating the regexp to allow both scenarios. Tested on aarch64-linux. Reviewed-By: Keith Seitz <keiths@redhat.com>
2025-07-19[gdb/testsuite] Fix gdb.multi/pending-bp.exp without python supportTom de Vries1-2/+4
With a gdb build without python support and test-case gdb.multi/pending-bp.exp, I run into: ... (gdb) python bp=[b for b in gdb.breakpoints() if b.number == 5][0]^M Python scripting is not supported in this copy of GDB.^M (gdb) FAIL: $exp: py_test_toggle_thread: find Python gdb.Breakpoint object ... Fix this by requiring python support for part of the test-case. Tested on aarch64-linux. Reviewed-By: Keith Seitz <keiths@redhat.com>
2025-07-19[gdb/testsuite] Fix gdb.base/break-dbg.exp without xml supportTom de Vries1-1/+11
With a gdb build without xml support and test-case gdb.base/break-dbg.exp, I run into: ... (gdb) catch syscall^M warning: Can not parse XML syscalls information; \ XML support was disabled at compile time.^M Catchpoint 11 (any syscall)^M (gdb) FAIL: $exp: catch syscall ... Fix this by updating the regexp. Tested on aarch64-linux. Reviewed-By: Keith Seitz <keiths@redhat.com>
2025-07-19Re: RELOC_AGAINST_DISCARDED_SECTION zero size reloc sectionsAlan Modra2-1/+14
Update the testsuite, so that is_generic ELF targets still do the linkonce1 test (as linkonce3).
2025-07-19Automatic date update in version.inGDB Administrator1-1/+1
2025-07-19RELOC_AGAINST_DISCARDED_SECTION zero size reloc sectionsAlan Modra7-52/+25
For some reason the initial implementation (commit 0672748ac053) of this macro didn't allow discarding of all relocs in a section, perhaps because doing so would require a testsuite change. This patch allows zero size relocation sections to result, and adjusts the testsuite. i386, x86_64, ppc and ppc64 code that avoids a memmove is also changed to allow zero size reloc sections, and arc fixed to actually adjust the reloc section header.
2025-07-18[gdb/testsuite] Fix gdb.arch/amd64-disp-step-self-call.exp on freebsdTom de Vries4-44/+38
On x86_64-freebsd, with test-case gdb.arch/amd64-disp-step-self-call.exp, I run into: ... (gdb) continue Continuing. Program received signal SIGBUS, Bus error. Object-specific hardware error. 0x000000080051492c in alarm () from /lib/libc.so.7 (gdb) FAIL: $exp: continue to breakpoint: test_call ... The behaviour is not specific to gdb, it can be reproduced by running the test-case executable: ... $ ./outputs/gdb.arch/amd64-disp-step-self-call/amd64-disp-step-self-call Bus error (core dumped) $ ... The bus error happens when executing this instruction in alarm: ... 0000000000093910 <alarm>: ... 9392c: 0f 29 45 d0 movaps %xmm0, -0x30(%rbp) ... because $rbp is not 16-byte aligned. This can be fixed by adding the missing frame setup instructions at the start of main in amd64-disp-step-self-call.S: ... main: + pushq %rbp + movq %rsp, %rbp ... Instead, fix this by moving main from the assembly file to the c file, which has the same effect. Also remove the done label, which looks like a copy-past left-over. Instead, add an unreachable function and use it where appropriate. Do the same for i386 case (which makes the source files identical for the amd64 and i386 case, but I decided to leave it like that). Tested on x86_64-freebsd and x86_64-linux.
2025-07-18gdb/testsuite: mark the start of each gdb.in.* log fileAndrew Burgess1-0/+4
Emit a line in the gdb.log file each time a new gdb.in.NUM command log is started. The gdb.log line includes the full filename for the new gdb.in.NUM file. This change will make it trivial to go from a FAIL in the gdb.log file to the gdb.in.NUM file that (should) reproduce the failure. When I encounter a failing test one of my first steps is usually to identify the gdb.in.NUM file and try re-running it to see if that reproduces the failure. Some tests create many very similar gdb.in.NUM files, so finding the exact one can sometimes be difficult. With this patch that task is now trivial. There should be no change in what is tested after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-07-18ld: Limit PR ld/25617 tests to glibc targetsH.J. Lu1-1/+1
Since PR ld/25617 tests expects glibc specific features, limit PR ld/25617 tests to glibc targets. PR ld/33169 * testsuite/ld-elf/no-section-header.exp: Return if not glibc targets. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-07-18Fix more unused variable warningsAlan Modra7-21/+6
2025-07-18Fix unused variable warningsAlan Modra8-23/+13
2025-07-18asan: undefined shiftAlan Modra1-9/+9
.bundle_align_mode 32 nop read.c:776:26: runtime error: shift exponent 32 is too large for 32-bit type 'unsigned int' Avoid this by using wider types in the expressions.
2025-07-18visium: use RELOC_AGAINST_DISCARDED_SECTIONAlan Modra1-11/+3
The initial visium support added in commit d924db559be9 didn't make use of RELOC_AGAINST_DISCARDED_SECTION, and so lacked code to remove relocations in debug sections.
2025-07-18METAG_RELOC_AGAINST_DISCARDED_SECTIONAlan Modra60-106/+124
Delete this macro which duplicates RELOC_AGAINST_DISCARDED_SECTION, and instead add an rnone parameter to the standard version.
2025-07-18Automatic date update in version.inGDB Administrator1-1/+1