aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-01-01unify 64-bit bfd checksMike Frysinger19-218/+579
Move the 64-bit bfd logic out of bfd/configure.ac and into bfd64.m4 under config so it can be shared between all the other subdirs. This replaces want64 with enable_64_bit_bfd which was already being declared, but not used directly.
2022-01-01Update Copyright year in gdb/testsuite/gdb.arch/powerpc-power10.expJoel Brobecker1-1/+1
This commit updates the copyright year range in the script gdb/testsuite/gdb.arch/powerpc-power10.exp. The update was performed by running gdb/copyright.py again, to make sure that the copyright year range will be automatically updated in years forward.
2022-01-01Fix copyright header in gdb/testsuite/gdb.arch/powerpc-power10.expJoel Brobecker1-1/+1
The copyright year and holder line is slight malformed, missing a space after a comma, and this is sufficient for gdb's copyright.py script to miss this file during its automated copyright year update. This commit fixes this.
2022-01-01gdb/copyright.py: Add update-netbsd.sh to MULTIPLE_COPYRIGHT_HEADERSJoel Brobecker1-0/+1
Add gdb/syscalls/update-netbsd.sh to the reminder printed at the end of the execution listing all the files where a manual update of the copyright header is needed. This scripts contains some inline code which includes a copyright header.
2022-01-01Manual copyright year update of various GDB filesJoel Brobecker4-6/+6
This commit updates the copyright year in some files where we have a copyright year outside of the copyright year, and thus are not included in gdb's copyright.py script.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker6683-6683/+6683
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2022-01-01Update Copyright Year in gdb, gdbserver and gdbreplay version outputJoel Brobecker3-3/+3
This commit changes the copyright year printed by gdb, gdbserver and gdbreplay when printing the tool's version.
2022-01-01ubsan: next_char_of_string signed integer overflowAlan Modra1-2/+2
Squash another totally useless fuzz report that I should have ignored. * read.c (next_char_of_string): Avoid integer overflow.
2022-01-01ubsan: bfd_mach_o_build_commands shift exponent 64 is too largeAlan Modra1-8/+8
* mach-o.c (bfd_mach_o_read_section_32): Limit alignment further. (bfd_mach_o_read_section_64): Likewise.
2022-01-01ubsan: signed integer multiply overflowAlan Modra1-1/+6
9223371018427387904 * 2 cannot be represented in type 'long', yes, but we don't care. * expr.c (expr): Avoid signed overflow.
2022-01-01asan: Null-dereference in _bfd_xcoff_copy_private_bfd_dataAlan Modra1-2/+2
sec->output_section will be NULL when objcopy removes sections. * coff-rs6000.c (_bfd_xcoff_copy_private_bfd_data): Protect against objcopy removing sections.
2022-01-01ubsan: integer overflow in section filepos subtractionAlan Modra1-2/+1
* elf.c (assign_file_positions_for_non_load_sections): Avoid signed integer overflow.
2022-01-01Remove unnecessary ELF_MINPAGESIZE definesAlan Modra4-18/+1
The idea of this patch is to make it easy to see which targets (just sparc) have ELF_MINPAGESIZE != ELF_COMMONPAGESIZE. * elf32-arm.c (ELF_MINPAGESIZE): Don't define. * elf32-metag.c: Likewise. * elfnn-aarch64.c: Likewise. * elf64-x86-64.c: Likewise. Also don't redefine a bunch of other macros for l1om elf64-target.h use that are unchanged from default.
2021-12-31ld-x86-64: Pass options to linker with "-Wl,"H.J. Lu1-20/+24
* testsuite/ld-x86-64/x86-64.exp: Pass options to linker with "-Wl,".
2022-01-01Automatic date update in version.inGDB Administrator1-1/+1
2021-12-31Do not call reinitialize_more_filter from avr_io_reg_read_commandTom Tromey1-2/+0
avr_io_reg_read_command is an ordinary gdb command, and so should not be calling reinitialize_more_filter. This patch removes it. I'm checking this in as obvious. Tested by rebuilding.
2021-12-31x86: Define check_relocs_failed in elfxx-x86.hH.J. Lu3-8/+4
* elf32-i386.c (check_relocs_failed): Moved to ... * elfxx-x86.h (check_relocs_failed): Here. New. * elf64-x86-64.c (check_relocs_failed): Removed.
2021-12-31Define X86_PCREL_TYPE_P/X86_SIZE_TYPE_P in elfxx-x86.hH.J. Lu4-38/+41
* elf32-i386.c: Don't include "elf/i386.h". (X86_PCREL_TYPE_P): Removed. (X86_SIZE_TYPE_P): Likewise. (elf_i386_check_relocs): Pass false to NEED_DYNAMIC_RELOCATION_P. (elf_i386_relocate_section): Pass false to GENERATE_DYNAMIC_RELOCATION_P and COPY_INPUT_RELOC_P. * elf64-x86-64.c: Don't include "elf/x86-64.h". (X86_PCREL_TYPE_P): Removed. (X86_SIZE_TYPE_P): Likewise. (elf_x86_64_check_relocs): Pass true to NEED_DYNAMIC_RELOCATION_P and X86_PCREL_TYPE_P. (elf_x86_64_relocate_section): Pass true to X86_PCREL_TYPE_P, X86_SIZE_TYPE_P, GENERATE_DYNAMIC_RELOCATION_P and COPY_INPUT_RELOC_P. * elfxx-x86.c: Don't include "elf/i386.h" nor "elf/x86-64.h". * elfxx-x86.h (X86_64_PCREL_TYPE_P): New. (I386_PCREL_TYPE_P): Likewise. (X86_PCREL_TYPE_P): Likewise. (X86_64_SIZE_TYPE_P): Likewise. (I386_SIZE_TYPE_P): Likewise. (X86_SIZE_TYPE_P): Likewise. (NEED_DYNAMIC_RELOCATION_P): Add IS_X86_64 and pass it to X86_PCREL_TYPE_P. (COPY_INPUT_RELOC_P): Likewise. (GENERATE_DYNAMIC_RELOCATION_P): Add IS_X86_64, pass it to X86_PCREL_TYPE_P and X86_SIZE_TYPE_P.
2021-12-31ld: fix coff PE SEHTamar Christina1-2/+2
COFF_WITH_pex64 and COFF_WITH_peAArch64 can't be true at the same time. That means that two conditionals that control the sorting of the .pdata section became a falsum. The testsuite doesn't catch this because the linker does the sorting and to link you require library support from the unwinder so we can't test from binutils in isolation. bfd/ChangeLog: 2021-12-31 Tamar Christina <tamar.christina@arm.com> PR ld/28682 * peXXigen.c: Fix conditional.
2021-12-31Automatic date update in version.inGDB Administrator1-1/+1
2021-12-30Automatic date update in version.inGDB Administrator1-1/+1
2021-12-29Use filtered output in show callbacksTom Tromey4-15/+15
"show" command callbacks, like most ordinary gdb commands, should use filtered output. I found a few that did not, so this patch changes them to use the filtered form.
2021-12-29Consistently Use ui_file parameter to show callbacksTom Tromey11-42/+46
I happened to notice that one "show" callback was printing to gdb_stdout rather than to the passed-in ui_file parameter. I went through all such callbacks and fixed them to consistently use the ui_file. Regression tested on x86-64 Fedora 34.
2021-12-29Use gdb_stdlog for MI debuggingTom Tromey2-7/+4
When MI debugging is enabled, the logging output should be sent to gdb_stdlog. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Use debug_prefixed_printf_cond_nofunc in index-cacheTom Tromey1-24/+19
This changes index-cache.c to use debug_prefixed_printf_cond_nofunc. As a side effect, logs are now written to gdb_stdlog. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Send minsym logging to gdb_stdlogTom Tromey1-3/+4
This changes minsyms.c to send logging output to gdb_stdlog. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Use gdb_stdlog for separate debug file loggingTom Tromey2-18/+23
This changes the separate debug file logging code (spread across two files) to use gdb_stdlog for its output. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Use debug_prefixed_printf_cond_nofunc in machoreadTom Tromey1-23/+14
This changes machoread.c to use debug_prefixed_printf_cond_nofunc. As a side effect, the logs are now written to gdb_stdlog. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Use debug_prefixed_printf_cond_nofunc in microblaze.cTom Tromey1-12/+3
This changes microblaze.c to use the standard logging macro. As a side effect, logs will now go to gdb_stdlog. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Send debugging data to gdb_stdlog in mips-linux-nat.cTom Tromey1-16/+17
This changes mips-linux-nat.c to send some logging output to gdb_stdlog, rather than stdout. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Send arch-utils error messages to gdb_stderrTom Tromey1-4/+7
This changes arch-utils.c to send some error messages to gdb_stderr. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Use correct stream for process record outputTom Tromey13-84/+113
The process record code often emits unfiltered output. In some cases, this output ought to go to gdb_stderr (but see below). In other cases, the output is guarded by a logging variable and so ought to go to gdb_stdlog. This patch makes these changes. Note that in many cases, the output to stderr is followed by a "return -1", which is how process record indicates an error. It seems to me that calling error here would be preferable, because, in many cases, that's all the caller does when it sees a -1. However, I haven't made this change. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Send jit.c errors to gdb_stderrTom Tromey1-10/+13
jit.c writes some error messages to gdb_stdout, but using gdb_stderr is better. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
2021-12-29Fix logging redirection bug with pagerTom Tromey3-1/+72
I noticed yesterday that if gdb output is redirected to a file, the pager will still be active. This is irritating, because the output isn't actually visible -- just the pager prompt. Looking in bugzilla, I found that this had been filed 17 years ago, as PR cli/8798. This patch fixes the bug. It changes the pagination code to query the particular ui-file to see if paging is allowable. The ui-file implementations are changed so that only the stdout implementation and a tee (where one sub-file is stdout) can page. Regression tested on x86-64 Fedora 34. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=8798
2021-12-29Remove unusual use of core_addr_eq and core_addr_hashTom Tromey3-27/+2
gdbtypes.h uses core_addr_eq and core_addr_hash in a weird way: taking the address of a member and then passing this (as a void*) to these functions. It seems better to simply inline the ordinary code here. CORE_ADDR is a scalar so it can be directly compared, and the identity hash function seems safe to assume as well. After this, core_addr_eq and core_addr_hash are unused, so this patch removes them.
2021-12-29gdb: Copy inferior properties in clone-inferiorLancelot SIX4-2/+123
This commit ensures that the following settings are cloned from one inferior to the new one when processing the clone-inferior command: - inferior-tty - environment variables - cwd - args Some of those parameters can be passed as command line arguments to GDB (-args and -tty), so one could expect the clone-inferior to respect those flags. The following debugging session illustrates that: gdb -nx -quiet -batch \ -ex "show args" \ -ex "show inferior-tty" \ -ex "clone-inferior" \ -ex "inferior 2" \ -ex "show args" \ -ex "show inferior-tty" \ -tty=/some/tty \ -args echo foo bar Argument list to give program being debugged when it is started is "foo bar". Terminal for future runs of program being debugged is "/some/tty". [New inferior 2] Added inferior 2. [Switching to inferior 2 [<null>] (/bin/echo)] Argument list to give program being debugged when it is started is "". Terminal for future runs of program being debugged is "". The other properties this commit copies on clone (i.e. CWD and the environment variables) are included since they are related (in the sense that they influence the runtime behavior of the program) even if they cannot be directly set using command line switches. There is a chance that this patch changes existing user workflow. I think that this change is mostly harmless. If users want to start a new inferior based on an existing one, they probably already propagate those settings to the new inferior in some way. Tested on x86_64-linux. Change-Id: I3b1f28b662f246228b37bb24c2ea1481567b363d
2021-12-29Automatic date update in version.inGDB Administrator1-1/+1
2021-12-28elf32-i386: Fix a typo in GOT commentsH.J. Lu1-1/+1
Entry offsets in the global offset table are multiples of 4, not 8. * elf32-i386.c (elf_i386_relocate_section): Fix a typo in GOT comments.
2021-12-28bfd: Don't check non-thin archive member file sizeH.J. Lu1-2/+4
There is no need to check member file size for thin archive member. * bfdio.c (bfd_bread): Don't check non-thin archive member file size.
2021-12-28gas reloc sortingAlan Modra6-45/+31
In some cases, eg. riscv_pre_output_hook, gas generates out-of-order relocations. Various places in the linker assume relocs are sorted by increasing r_offset, which is normally the case. Provide GAS_SORT_RELOCS to handle unsorted relocs. bfd/ PR 28709 * elf32-nds32.c (nds32_insertion_sort): Make static. * elf32-nds32.h (nds32_insertion_sort): Delete declaration. gas/ PR 28709 * write.c (write_relocs): Implement reloc sorting by r_offset when GAS_SORT_RELOCS. * config/tc-nds32.c (compar_relent, nds32_set_section_relocs): Delete. * config/tc-nds32.h (nds32_set_section_relocs): Don't declare. (SET_SECTION_RELOCS): Don't define. (GAS_SORT_RELOCS): Define. * config/tc-riscv.h (GAS_SORT_RELOCS): Define.
2021-12-28ld: Fix testcase errors due to -shared not support.jiawei2-1/+6
Reviewed-by: Jim Wilson <jim.wilson.gcc@gmail.com> ld/ChangeLog: * testsuite/ld-ctf/ctf.exp: Add shared lib check. * testsuite/ld-plugin/lto.exp: Add lto shared check.
2021-12-28Automatic date update in version.inGDB Administrator1-1/+1
2021-12-27elf: Update comments for check_relocs in elf_backend_dataH.J. Lu1-7/+5
Since commit 5c3261b0e834647cf9eb555320e20871b7854f98 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Oct 16 03:49:54 2017 -0700 ELF: Call check_relocs after opening all inputs check_relocs is called after opening all inputs. * elf-bfd.h (elf_backend_data::check_relocs): Update comments.
2021-12-27ld: Remove emultempl/linux.emH.J. Lu1-226/+0
Remove emultempl/linux.em whose last usage was removed by commit c65c21e1ffd1e02d9970a4bca0b7e384788a50f0 Author: Alan Modra <amodra@gmail.com> Date: Mon Apr 16 22:14:01 2018 +0930 various i386-aout and i386-coff target removal Also tidies some other aout leftovers in binutils-common.exp.
2021-12-27Automatic date update in version.inGDB Administrator1-1/+1
2021-12-26Automatic date update in version.inGDB Administrator1-1/+1
2021-12-25Automatic date update in version.inGDB Administrator1-1/+1
2021-12-24Remove gdb_print_host_addressTom Tromey6-175/+107
gdb_print_host_address is just a simple wrapper around fprintf_filtered. However, it is readily replaced in all callers by a combination of %s and call to host_address_to_string. This also simplifies the code, so I think it's worthwhile to remove this function. Regression tested on x86-64 Fedora 64.
2021-12-24Move gdb_bfd_errmsg to gdb_bfd.cTom Tromey4-35/+37
gdb_bfd.c contains most of gdb's BFD-related utility functions. However, gdb_bfd_errmsg is in utils.c. It seemed better to me to move this out of util.[ch] and into the BFD-related file instead. Tested by rebuilding.
2021-12-24RISC-V: Rewrite the csr testcases.Nelson Chu42-1521/+3567
Maskray (Fangrui Song) had suggested me before that we should combine multiple testcases into one file as possible as we can. So that we can more easily understand what these test cases are testing, and easier to maintain. Therefore, this patch rewrites all csr testcases, to make them more clean. gas/ * testsuite/gas/riscv/csr-fail-nonexistent.d: Renamed from priv-reg-fail-nonexistent testcase. * testsuite/gas/riscv/csr-fail-nonexistent.: Likewise. * testsuite/gas/riscv/csr-fail-nonexistent.s: Likewise. * testsuite/gas/riscv/csr-insns-pseudo-noalias.d: Renamed from priv-reg-pseudo testcase. * testsuite/gas/riscv/csr-insns-pseudo.d: Likewise. * testsuite/gas/riscv/csr-insns-pseudo.s: Likewise. * testsuite/gas/riscv/csr-insns-read-only.d: Renamed from priv-reg-fail-read-only-02 testcase. * testsuite/gas/riscv/csr-insns-read-only.l: Likewise. * testsuite/gas/riscv/csr-insns-read-only.s: Likewise. * testsuite/gas/riscv/h-ext-32.d: Moved hypervisor csrs to csr.s. * testsuite/gas/riscv/h-ext-32.s: Likewise. * testsuite/gas/riscv/h-ext-64.d: Likewise. * testsuite/gas/riscv/h-ext-64.s: Likewise. * testsuite/gas/riscv/csr.s: Renamed from priv-reg.s, and then added the hypervisor csrs. * testsuite/gas/riscv/csr-version-1p9p1.d: The csr testcase when the privileged spec is 1.9.1. Also tested all invalid csr warnings when -mcsr-check is enabled. * testsuite/gas/riscv/csr-version-1p9p1.l: Likewise. * testsuite/gas/riscv/csr-version-1p10.d: Likewise, but the privileged spec is 1.10.. * testsuite/gas/riscv/csr-version-1p10.l: Likewise. * testsuite/gas/riscv/csr-version-1p11.d: Likewise, but the privileged spec is 1.11. * testsuite/gas/riscv/csr-version-1p11.l: Likewise. * testsuite/gas/riscv/csr-version-1p12.d: Likewise, but the privileged spec is 1.12. * testsuite/gas/riscv/csr-version-1p12.l: Likewise. * testsuite/gas/riscv/priv-reg*: Removed or Renamed.