aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
10 daysRemove ada_binop_in_boundsTom Tromey2-17/+11
ada_binop_in_bounds can be merged with its sole caller. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysRemove ada_ternop_sliceTom Tromey2-19/+13
ada_ternop_slice can be merged with its sole caller. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysRemove ada_equal_binopTom Tromey2-17/+15
ada_equal_binop can be merged with its sole caller. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysRemove ada_unop_in_rangeTom Tromey2-15/+13
ada_unop_in_range can be merged with its sole caller. This change points out that one of the arguments was not needed. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysUse ada_fvar_tracking in finish-var-size.expTom Tromey1-1/+1
commit a16f37e8 changed finish-var-size.exp to use have_fvar_tracking. However, in Ada tests, ada_fvar_tracking must be used instead.
10 daysCorrect -Ue output for nm, objdump and readelfAndrew C Aitchison3-6/+6
..., like PR33360 does for strings. Signed-off-by: Andrew C Aitchison <github@aitchison.me.uk>
10 daysnm: fix treating an ifunc symbol as a stab if '--ifunc-chars=--' is givenDmitry Klochkov2-3/+24
If an ifunc symbol is processed in print_symbol(), a 'type' field of a 'syminfo' structure is set to any character specified by a user with an '--ifunc-chars' option. But afterwards the 'type' field is used to check whether a symbol is a stab in print_symbol_info_{bsd,sysv}() functions in order to print additional stab related data. If the 'type' field equals '-', a symbol is treated as a stab. If '--ifunc-chars=--' is given, all ifunc symbols will be treated as stab symbols and uninitialized stab related fields of the 'syminfo' structure will be printed which can lead to segmentation fault. To fix this, check if a symbol is a stab before override the 'type' field. Also, add a test case for this fix. PR binutils/32556 * nm.c (extended_symbol_info): Add is_stab. (print_symbol): Check if a symbol is a stab. (print_symbol_info_bsd): Use info->is_stab. (print_symbol_info_sysv): Use info->is_stab. * testsuite/binutils-all/nm.exp: Test nm --ifunc-chars=--. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32556 Fixes: e6f6aa8d184 ("Add option to nm to change the characters displayed for ifunc symbols") Signed-off-by: Dmitry Klochkov <dmitry.klochkov@bell-sw.com>
10 daysPR 33406 SEGV in dump_dwarf_sectionAlan Modra1-4/+6
Trying to dump .sframe in a PE file results in a segfault accessing elf_section_data. * objdump (dump_sframe_section, dump_dwarf_section): Don't access elf_section_type without first checking the file is ELF.
10 daysobjcopy: when an invalid bfd target string is used as a target option, print ↵Nick Clifton1-3/+12
an error message that references the target string, not the file being copied
10 daysobjdump gcc_compiled and gcc2_compiledAlan Modra1-17/+4
* objdump.c (remove_useless_symbols): Deal with gcc_compiled and gcc2_compiled here.. (compare_symbols): ..rather than here.. (disassemble_section): ..and here.
10 daysRevert "objdump: Check the SEC_CODE bit for code"Alan Modra1-1/+0
PR 33389 This reverts commit 6b27a220321ecead5435b170f1db02f1876cee08.
10 daysChange dwarf_record_line_1 to be a methodTom Tromey1-22/+16
This changes dwarf_record_line_1 to be a method of lnp_state_machine, simplifying it a bit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysChange dwarf_finish_line to be a methodTom Tromey1-14/+10
This changes dwarf_finish_line to be a method of lnp_state_machine, simplifying it a bit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysAdd m_builder member to lnp_state_machineTom Tromey1-6/+8
I noticed that several spots in lnp_state_machine fetch the CU's builder. Since this can't change over the lifetime of the object, it seemed nicer to simply cache it. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysChange dwarf_record_line_p to be a methodTom Tromey1-11/+8
This changes dwarf_record_line_p to be a method of lnp_state_machine. This simplifies it, as it can refer to members of the object. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysBoolify line-program.cTom Tromey2-8/+8
This changes some code in line-program.c to use bool rather than int. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysMove compute_include_file_name earlierTom Tromey1-75/+69
I noticed that the compute_include_file_name intro comment was slightly wrong, and while looking at this, I also noticed that it has a single caller. This patch hoists it slightly so that a forward declaration isn't needed. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysMove lnp_state_machine to new fileTom Tromey5-753/+815
This patch moves lnp_state_machine and some supporting code to a new file, dwarf2/line-program.c. The main benefit of this is shrinking dwarf2/read.c a bit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
10 daysAutomatic date update in version.inGDB Administrator1-1/+1
10 daysUse type-specific lookups in cp-support.cTom Tromey1-2/+4
cp-support.c has code to substitute types for typedef names when canonicalizing a C++ name. I believe this code can use type-specific search domains; and doing this greatly speeds up some cases. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33081
10 daysAvoid symbol lookup for field names in C parserTom Tromey1-103/+193
Currently, the C parser looks up any name it finds -- at lex time. However, in an expression like "obj->field", looking up the field name is wasteful, and can sometimes even yield pathological symtab expansion behavior. This patch arranges to avoid the name lookup in this case. (It would be nice to really clean up this area, but I'm not convinced it can readily be done in a yacc parser.) Some special code is required for the C++ construct where a qualified name is used, like "obj->type1::type2::field". Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33081
10 daysChange how C parser looks up type tag namesTom Tromey1-58/+79
In an earlier version of this series, Simon noticed that something like "ptype struct type" was much slower. The deep problem here is the hack in best_symbol -- in this particular case the C parser is including SEARCH_VAR_DOMAIN, which means that a type is not "best". Fixing best_symbol would be good to do, but it's difficult and I already had many struggles getting this series to this point. So, rather than fix that, I elected to modify the parser. The key insight here is that the name lookup in classify_name is useless when a tag name is expected. This patch adds a flag so that this lookup is not done. (Incidentally, this kind of thing is much more straightforward in a recursive descent parser, something like classify_name would only be applied post-lexing where appropriate.) This change speeds up the lookup by avoiding the best_symbol hack, instead searching only for a type. Acked-By: Simon Marchi <simon.marchi@efficios.com> Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
10 daysgdb: Add svr4-tls-tdep.o to list of objects of i*86 targetsSergio Durigan Junior1-1/+1
GDB currently fails to build from source on i386 if compiled with --enable-64-bit-bfd. This is happening because svr4-tls-tdep.o is missing from the gdb_target_obs variable, while amd64-linux-tdep.o is obviously there. Fix the problem by adding svr4-tls-tdep.o to the object list, but only when --enable-64-bit-bfd is provided. Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33399
11 daysChange return value of _bfd_mmap_temporaryTom Tromey3-21/+19
_bfd_mmap_temporary will return MAP_FAILED in some cases, but only one caller was prepared for this. This caused a couple of issues in gdb. This patch chnages _bfd_mmap_temporary to always return NULL on failure. It also changes the logic to fall back to bfd_malloc if mmap fails. I took the opportunity to change some "(void *) -1" to MAP_FAILED where appropriate. Tested by "make check" in binutils, and also by applying a hack from bug 33354 to gdb and testing something approximating the original report. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32542 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33354
11 daysRequire Tcl 8.6.2Tom Tromey2-53/+7
This changes the gdb test suite to require Tcl 8.6.2. This allows the removal of some more compatibility code. I wrote this as a separate patch so make it simpler to drop if some platform only provides Tcl 8.5. According to research in the bug, though, it seems like this isn't likely. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33205 Approved-By: Simon Marchi <simon.marchi@efficios.com>
11 daysRewrite tcl_version_at_leastTom Tromey1-15/+3
tcl_version_at_least can more easily be expressed using the built-in "package" command. Approved-By: Simon Marchi <simon.marchi@efficios.com>
11 daysRequire Tcl 8.5Tom Tromey1-17/+2
This patch changes the gdb test suite to require Tcl 8.5. It also removes the one pre-8.5 compatibility function. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33205 Approved-By: Simon Marchi <simon.marchi@efficios.com>
11 daysvms-alpha: sections array index sanity checksAlan Modra1-1/+7
Adds a couple of missing bound checks. * vms-alpha.c (alpha_vms_fix_sec_rel): Sanity check relocation section index. (alpha_vms_bfd_final_link): Assert that section index is sane.
11 daysvms-alpha: ehdr checksAlan Modra1-29/+28
I noticed that _bfd_vms_slurp_ehdr wrongly used buf_size (rather than rec_size) when sanity checking. * vms-alpha.c (_bfd_vms_slurp_ehdr): Don't allow access to uninitialised buffer memory. Tidy code generally, using remaining record length for sanity checks.
11 daysPR 33385 vms archivesAlan Modra3-0/+14
Commit 5c4ce239a3ab "Tidy bfdio to consistenly use containing archive" broke vms archive handling, which has some horrible hacks involving use of a special iovec for archive elements. Modify the generic archive handling code to not use the archive iovec when it differs from the element iovec. Also, various commits involving seek optimisation broke the vms archive handling, which needs to see a rewind on an archive element. * bfdio.c (bfd_read, bfd_write, bfd_tell, bfd_flush), (bfd_stat, bfd_seek, bfd_mmap): Do not use the archive bfd for IO when the archive and element iovec differ. * plugin.c (bfd_plugin_open_input), (bfd_plugin_close_file_descriptor): Likewise. * vms-lib.c (vms_lib_bopen): Force bfd_seek to call iovec seek.
11 daysPR 33385 unsupported relocsAlan Modra1-2/+2
Commit 96d3b80f5498 changed a couple of reloc functions to return false, and propagated the error. They previously did nothing, so revert to that sad state. * vms-alpha.c (alpha_vms_add_lw_reloc): Return true. (alpha_vms_add_qw_reloc): Likewise.
11 daysPR 33385 DST handlingAlan Modra1-23/+31
Commit 816995444667, a fix for a fuzzer testcase resulting in a buffer overflow, broke reading of DST. DST is a special case where a first pass over the section just sizes it. Commit a3c0896d80d2, another buffer overflow fix, wrongly removed a line incrementing DST record length. * vms-alpha.c (image_write): Don't do bounds check for sections in memory without contents. (evax_bfd_print_dst): Add one to length.
11 daysPR 33385 EOMAlan Modra1-2/+2
Another PR 21813 modification. * vmd-alpha.c (_bfd_vms_slurp_eeom): Allow 10 byte EOM. Don't set has_transfer or access fields past 10 bytes unless the entire EEOM is there.
11 daysPR 33385, Extended Image HeaderAlan Modra2-19/+17
This modifies some of the PR 21813 fixes, allowing for smaller EIHD. Not knowing any better, I chose to use EIHD__C_LENGTH as the minimum length. include/ * vms/eihd.h (EIHD__C_LENGTH): Comment. bfd/ * vms-alpha.c (_bfd_vms_slurp_eihd): Remove size check duplicating that done by the caller of this function. (alpha_vms_object_p): Allow smaller EIHD. (evax_bfd_print_image): Likewise. Don't print fields past the record size.
11 daysbinutils: Require GNU tail for 'objdump -Wi' testH.J. Lu7-4/+76
testsuite/binutils-all/objdump.exp has set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump.tail"] But the default Solaris tail doesn't support "tail -n +4". Add ACX_PROG_GNU_TAIL to use GNU tail for 'objdump -Wi' test. Tested on Linux and Solaris. binutils/ PR binutils/33396 * Makefile.am (check-DEJAGNU): Also export TAIL. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. * configure.ac: Add ACX_PROG_GNU_TAIL. * testsuite/binutils-all/objdump.exp: Require GNU tail for 'objdump -Wi' test and replace tail with $env(TAIL). config/ PR binutils/33396 * acx.m4 (ACX_PROG_GNU_TAIL): New. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
11 daysobjdump: Check the SEC_CODE bit for codeH.J. Lu1-0/+1
If a shared library has $ readelf -D -sW x.so | grep _PROCEDURE_LINKAGE_TABLE_ 3: 00000000000002c0 0 OBJECT GLOBAL DEFAULT 5 _PROCEDURE_LINKAGE_TABLE_ $ Disassembler treats PLT0 as data: $ objdump -dw x.so x.so: file format elf64-x86-64 Disassembly of section .plt: 00000000000002c0 <_PROCEDURE_LINKAGE_TABLE_>: 2c0: ff 35 7a 01 10 00 ff 25 7c 01 10 00 0f 1f 40 00 .5z....%|.....@. 00000000000002d0 <foo@plt>: 2d0: ff 25 7a 01 10 00 jmp *0x10017a(%rip) # 100450 <foo> 2d6: 68 00 00 00 00 push $0x0 2db: e9 e0 ff ff ff jmp 2c0 <_PROCEDURE_LINKAGE_TABLE_> Disassembly of section .text: 00000000000002e0 <func>: 2e0: e8 eb ff ff ff call 2d0 <foo@plt> 2e5: c3 ret Check the SEC_CODE bit on section for code. PR binutils/33389 * objdump.c (disassemble_section): Check SEC_CODE for code. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
11 daysgdb/testsuite: small fix for amd64-extended-prologue-analysis.expAndrew Burgess1-2/+6
I noticed I was sometimes getting this failure: FAIL: gdb.arch/amd64-extended-prologue-analysis.exp: offset \ initialization: ASM source: gdb_breakpoint: set breakpoint \ at *0x0000000000401151 The problem was introduced in commit: commit f9aa48dc545ef511e19f4dfab88a196b820fd2da Date: Thu Aug 28 11:50:13 2025 +0000 gdb, amd64: extend the amd64 prologue analyzer to skip register pushes A gdb_test_multiple exits early when processing the results of a 'disassemble' command, without waiting for the prompt to be seen. This can leave unhandled output in expect's input buffer, which will then throw off the next test. Update the gdb_test_multiple to wait for the prompt before declaring the test passed. After this I'm no longer seeing the above failure. There should be no change in what is tested after this commit.
11 daysx86: constrain and fix use of the "nojumps" .arch modifierJan Beulich7-21/+84
As said by the paragraph of the description that isn't modified here (a few lines up), this was only ever supposed to be used with 16-bit architectures. Actually enforcing this allows code in md_estimate_size_before_relax() to move to a less frequently used code path. (For backwards compatibility, keep accepting "jumps" also with 32- or 64-bit architectures.) Repeat the constraint also in the 2nd paragraph of the doc on this subject. And while there also insert a missing insn in the related i386-Jumps section. Furthermore checking a global variable during late processing is wrong. We need to record the state in the fragment, and use that rather than the state of the variable at the end of parsing all input. Seeing that there's no testing of the functionality at all, add a testcase as well.
11 daysx86: make TC_FRAG_INIT() resolve to a function callJan Beulich2-37/+25
This way we can avoid making various global variables non-static. Their set is to only ever grow, really.
11 daysbfd: Add i386_pe_big_vec vector to win64 targetsJeffrey Knockel1-1/+1
251dae91074170036c1a76c5e5df1f45197d7feb added i386_pe_big_vec to win32 targets but did not add it to win64 ones. Adding i386_pe_big_vec vector to win64 targets fixes an issue where a 64-bit assembler on windows would fail to create bigobj files when operating with 32-bit word size. E.g., before this change, with a 64-bit toolchain: $ echo 'int main(void) { return 100; }' \ | gcc -m32 -Wa,-mbig-obj -x c -c -o main.o - $ objdump.exe -f main.o main.o: file format pe-i386 architecture: i386, flags 0x00000039: HAS_RELOC, HAS_DEBUG, HAS_SYMS, HAS_LOCALS start address 0x00000000 But after this change, the output file format is correctly bigobj: $ echo 'int main(void) { return 100; }' \ | gcc -m32 -Wa,-mbig-obj -x c -c -o main.o - $ objdump.exe -f main.o main.o: file format pe-bigobj-i386 architecture: i386, flags 0x0000003d: HAS_RELOC, HAS_LINENO, HAS_DEBUG, HAS_SYMS, HAS_LOCALS start address 0x00000000 Although the above multilib compilation issue was the motivation for this patch, this change has other positive consequences, such as allowing the 64-bit windows build of objdump to disassemble pe-bigobj-i386 format object files, etc. Signed-off-by: Jeffrey Knockel <jeff@jeffreyknockel.com>
11 daysMicroBlaze: Add microblaze_get_next_pcsGopi Kumar Bulusu1-0/+94
This patch enables software single stepping for gdbserver target Includes fix for Bug 33381 using core_addr_to_string_nz * gdb/microblaze-tdep.c: Add microblaze_get_next_pcs Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com> Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com> Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com> Signed-off-by: Gopi Kumar Bulusu <gopi@sankhya.com> Approved-By: Simon Marchi <simon.marchi@efficios.com>
11 daysAutomatic date update in version.inGDB Administrator1-1/+1
12 daysld: Limit "readelf --got-contents" testsH.J. Lu2-46/+63
Since "readelf --got-contents" tests use -melf_i386, -melf_x86_64 and -melf32_x86_64 emulations, limit theses tests to linker supporting those emulations, pass --rosegment to linker and output libgot-1-i386.so, libgot-1-x64.so, libgot-1-x32.so. PR ld/33350 * testsuite/ld-i386/binutils.exp: Limit tests to linker with -melf_i386 support, pass --rosegment to linker and output libgot-1-i386.so. * testsuite/ld-x86-64/binutils.exp: Limit -melf_x86_64 tests to linker with -melf_x86_64 support, limit -melf32_x86_64 tests to linker with -melf32_x86_64 support, pass --rosegment to linker and output libgot-1-x64.so/libgot-1-x32.so. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
12 dayself: Define more SHT_SUNW_XXXH.J. Lu2-21/+59
binutils/ * readelf.c (get_solaris_section_type): Use SHT_SUNW_XXX and add SHT_SUNW_phname and SHT_SUNW_symtabnsort. include/ * elf/common.h (SHT_SUNW_symtabnsort): New. (SHT_SUNW_ancillary): Likewise. (SHT_SUNW_capchain): Likewise. (SHT_SUNW_capinfo): Likewise. (SHT_SUNW_symsort): Likewise. (SHT_SUNW_tlssort): Likewise. (SHT_SUNW_LDYNSYM): Likewise. (SHT_SUNW_dof): Likewise. (SHT_SUNW_cap): Likewise. (SHT_SUNW_SIGNATURE): Likewise. (SHT_SUNW_ANNOTATE): Likewise. (SHT_SUNW_DEBUGSTR): Likewise. (SHT_SUNW_DEBUG): Likewise. (SHT_SUNW_verdef): Likewise. (SHT_SUNW_verneed): Likewise. (SHT_SUNW_versym): Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
12 days[gdb/testsuite] Error out on clean_restart <absolute filename>Tom de Vries2-0/+7
Error out in proc clean_restart if the argument is an absolute filename. Likewise in proc mi_clean_restart. Tested on x86_64-linux.
12 daysREADME: don't talk about libg++Sam James1-3/+3
Gone since 2001 or so.
12 daysgdb: Add i386-gnu-tdep to the list of objects for x86_64-*-gnu*Sergio Durigan Junior1-1/+1
When starting GDB on Hurd amd64, one will currently see the following warning: # gdb -q gdb: warning: A handler for the OS ABI "GNU/Hurd" is not built into this configuration of GDB. Attempting to continue with the default i386 settings. (gdb) This happens because, in gdb/configure.tgt, the "x86_64-*-gnu*" target is not pulling in the i386-gnu-tdep.o object, which means that only 64-bit debugging is currently supported. The fix here is to add i386-gnu-tdep.o to the gdb_target_obs for Hurd amd64. Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net> Suggested-by: Andrew Burgess <aburgess@redhat.com> Reported-by: Mark Wielaard <mark@klomp.org> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33377 Approved-by: Kevin Buettner <kevinb@redhat.com>
12 daysAutomatic date update in version.inGDB Administrator1-1/+1
12 daysUpdate gdb/NEWS after GDB 17 branch creation.Joel Brobecker1-1/+3
This commit a new section for the next release branch, and renames the section of the current branch, now that it has been cut.
12 daysBump version to 18.0.50.DATE-git.Joel Brobecker1-1/+1
Now that the GDB 17 branch has been created, this commit bumps the version number in gdb/version.in to 18.0.50.DATE-git For the record, the GDB 17 branch was created from commit 46ada32fc979550ad4f46792b74c182bb7232aeb.