aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-19x86: Count PLT for GOTOFF relocation against IFUNC symbolH.J. Lu8-2/+84
Since GOTOFF relocations against IFUNC symbols must go through PLT, set PLT reference count to 1 for GOTOFF relocation. bfd/ PR ld/27998 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Count PLT for GOTOFF relocation against IFUNC symbols. (_bfd_x86_elf_adjust_dynamic_symbol): Likewise. ld/ PR ld/27998 * testsuite/ld-i386/i386.exp: Run PR ld/27998 tests. * testsuite/ld-i386/pr27998a.d: New file. * testsuite/ld-i386/pr27998a.s: Likewise. * testsuite/ld-i386/pr27998b.d: Likewise. * testsuite/ld-i386/pr27998b.s: Likewise.
2021-06-19gdb/gdbserver: switch to AC_CONFIG_MACRO_DIRSMike Frysinger10-58/+54
These dirs don't use automake, so use AC_CONFIG_MACRO_DIRS to specify ../config as a search dir for m4 macros. This allows removal of a lot of hand-written m4_include's from acinclude.m4 files, and simplifies use of `aclocal` or `autoreconf` as manual -I is not needed.
2021-06-19sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definitionSimon Marchi2-27/+31
I get this when building with gcc 11: CC common/common_libcommon_a-sim-load.o In file included from /home/simark/src/binutils-gdb/sim/common/sim-n-bits.h:27, from /home/simark/src/binutils-gdb/sim/common/sim-bits.c:259, from /home/simark/src/binutils-gdb/sim/common/sim-bits.h:599, from /home/simark/src/binutils-gdb/sim/common/sim-basics.h:122, from /home/simark/src/binutils-gdb/sim/common/sim-load.c:30: /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:27: error: 'offset_16' defined but not used [-Werror=unused-function] 39 | #define offset_N XCONCAT2(offset_,N) | ^~~~~~~ /home/simark/src/binutils-gdb/sim/../include/symcat.h:23:26: note: in definition of macro 'CONCAT2' 23 | #define CONCAT2(a,b) a##b | ^ /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:18: note: in expansion of macro 'XCONCAT2' 39 | #define offset_N XCONCAT2(offset_,N) | ^~~~~~~~ /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:138:1: note: in expansion of macro 'offset_N' 138 | offset_N (unsigned_N *x, | ^~~~~~~~ offset_N uses INLINE_SIM_ENDIAN, which uses UNUSED to put the "unused" attribute. However, it appears after the function's return type, which seems to make it not apply to the function. Moving it to before the return type fixes the error. Change all instances found in that file. sim/common/ChangeLog: * sim-inline.h: Move UNUSED before TYPE. Change-Id: Ide20106683ed7a9ebf35d484dabf70b309cb1ba6
2021-06-19sim: unify dtc tool checksMike Frysinger9-100/+112
Only one arch uses this currently, but others could too. By moving it up to the common checks, it'll also let us simplify the moxie code significantly.
2021-06-19sim: ppc: rename inline defines to match common codeMike Frysinger6-52/+64
Use the same basic names as the common sim inline logic so we can merge the two. We don't do that here, just prepare for it. The common code seems to be based on the ppc version but with slightly different names as it was cleaned up & generalized. I *think* these concepts are the same, so binding them together is OK, but maybe I'm misreading them. If so, can always tweak them later. REVEAL_MODULE -> H_REVEALS_MODULE INLINE_MODULE -> C_REVEALS_MODULE
2021-06-19sim: drop old BUILT_SRC_FROM_COMMON refMike Frysinger2-3/+4
The code that set & used this variable was deleted long ago, but the clean target was missed. Clean that up now.
2021-06-20Automatic date update in version.inGDB Administrator1-1/+1
2021-06-19elf: Correct DT_TEXTREL warning in PDEH.J. Lu7-0/+48
Change ld: warning: creating DT_TEXTREL in a PIE to ld: warning: creating DT_TEXTREL in a PDE on PDE. bfd/ * elflink.c (bfd_elf_final_link): Correct DT_TEXTREL warning in PDE. ld/ * testsuite/ld-x86-64/textrel-1.err: New file. * testsuite/ld-x86-64/textrel-1a.s: Likewise. * testsuite/ld-x86-64/textrel-1b.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run textrel-1 tests.
2021-06-19sim: unify gettext/intl probing logicMike Frysinger77-2744/+132
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: unify toolchain dependency logicMike Frysinger69-33282/+814
The common dir is already probing this info since it's using automake, so pass it down to the subdirs so they don't have to probe it at all.
2021-06-19sim: unify toolchain probing logicMike Frysinger71-42429/+1131
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19elf: Update GNU_PROPERTY_UINT32_[AND|OR]_XXX testsH.J. Lu9-8/+79
1. Skip am33_2.0-*-* hppa*-*-hpux* mn10300-*-* since assembly source file for the HPPA assembler is renamed and modifed by sed. mn10300 has RELA relocations in .note.gnu.property section which elf_parse_notes doesn't support. 2. Pass --generate-missing-build-notes=no to assembler. 3. Allow other note sections for xtensa. * testsuite/ld-elf/property-and-1.d: Skip am33_2.0, hppa-hpux and mn10300. Pass --generate-missing-build-notes=no to assembler. Allow other note sections for xtensa. * testsuite/ld-elf/property-and-2.d: Likewise. * testsuite/ld-elf/property-and-3.d: Likewise. * testsuite/ld-elf/property-and-4.d: Likewise. * testsuite/ld-elf/property-or-1.d: Likewise. * testsuite/ld-elf/property-or-2.d: Likewise. * testsuite/ld-elf/property-or-3.d: Likewise. * testsuite/ld-elf/property-or-4.d: Likewise.
2021-06-19sim: unify bfd library dependency testing logicMike Frysinger109-238842/+8112
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19sim: mips: drop unused AC_PATH_X callMike Frysinger3-210/+8
We don't use anything from X, so no sense in probing the env.
2021-06-19sim: unify various library testing logicMike Frysinger72-4428/+397
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-19ubsan: vax: pointer overflowAlan Modra2-1/+5
"VAX export class call relocation test" fails with ubsan on a 32-bit host. * vax-dis.c (print_insn_vax): Avoid pointer overflow.
2021-06-19ubsan errors when 32-bit bfdAlan Modra2-3/+7
A shift count exceeding the size of the value is undefined behaviour, and so is negating a signed LONG_MIN. * config/tc-z80.c (signed_overflow, unsigned_overflow): Avoid UB.
2021-06-19ppc raw test failure when 32-bit bfdAlan Modra3-2/+7
The test contained an expression that can't be evaluated unless expressions are 64-bit. * testsuite/gas/ppc/raw.s: Use 0 as pli constant. * testsuite/gas/ppc/raw.d: Update to suit.
2021-06-19Fix another strncpy warningAlan Modra2-1/+6
* tic30-dis.c (get_register_operand): Don't ask strncpy to fill entire buffer.
2021-06-19dwarf.c: string_fortify.h strncpy errorAlan Modra2-16/+14
In function 'strncpy', inlined from 'display_debug_lines_decoded' at /home/alan/src/binutils-gdb/binutils/dwarf.c:5434:5, inlined from 'display_debug_lines' at /home/alan/src/binutils-gdb/binutils/dwarf.c:5567:21: /usr/include/bits/string_fortified.h:95:10: error: '__builtin_strncpy' specified bound 36 equals destination size [-Werror=stringop-truncation] No need for strncpy here, the string being copied always fits the destination buffer. * dwarf.c (display_debug_lines_decoded): Use memcpy rather than strncpy when trimming file name length to MAX_FILENAME_LENGTH. Don't make an unnecessary copy when length is good.
2021-06-19Automatic date update in version.inGDB Administrator1-1/+1
2021-06-18Fix powerpc-power8.exp test with new mnemonicsCarl Love3-4/+11
This patch updates the gdb test to use the new bgetar and bnstarl mnemonics introduced in commit 5a4037661bccd156d65093f1f0cf2cd43f31e9d9. The test previously used the bctar and bctarl mnemonics. gdb/testsuite/ChangeLog 2021-06-17 Carl Love <cel@us.ibm.com> * gdb.arch/powerpc-power8.exp(bctar, bctarl): Update mnemonics to bgetar and bgetarl. * gdb.arch/powerpc-power8.s((bctar, bctarl): Update comments for mnemonics to bgetar and bnstarl.
2021-06-18ld.texi: Move -z unique-symbol after -z undefs.H.J. Lu2-6/+10
* ld.texi: Move -z unique-symbol after -z undefs.
2021-06-18sim: unify -Werror build settingsMike Frysinger107-3524/+324
Move these options up to the common dir so we only test & export them once across all ports. It also enables -Werror usage on the common files we've been pulling out of arch subdirs.
2021-06-18elf: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXXH.J. Lu23-0/+353
Implement GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX: https://sourceware.org/pipermail/gnu-gabi/2021q1/000467.html 1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI #define GNU_PROPERTY_UINT32_AND_LO 0xb0000000 #define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff A bit in the output pr_data field is set only if it is set in all relocatable input pr_data fields. If all bits in the the output pr_data field are zero, this property should be removed from output. If the bit is 1, all input relocatables have the feature. If the bit is 0 or the property is missing, the info is unknown. 2. GNU_PROPERTY_UINT32_OR_LO..GNU_PROPERTY_UINT32_OR_HI #define GNU_PROPERTY_UINT32_OR_LO 0xb0008000 #define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff A bit in the output pr_data field is set if it is set in any relocatable input pr_data fields. If all bits in the the output pr_data field are zero, this property should be removed from output. If the bit is 1, some input relocatables have the feature. If the bit is 0 or the property is missing, the info is unknown. bfd/ * elf-properties.c (_bfd_elf_parse_gnu_properties): Handle GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI, GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI. (elf_merge_gnu_properties): Likewise. binutils/ * readelf.c (print_gnu_property_note): Handle GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI, GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI. include/ * elf/common.h (GNU_PROPERTY_UINT32_AND_LO): New. (GNU_PROPERTY_UINT32_AND_HI): Likewise. (GNU_PROPERTY_UINT32_OR_LO): Likewise. (GNU_PROPERTY_UINT32_OR_HI): Likewise. ld/ * testsuite/ld-elf/property-and-1.d: New file. * testsuite/ld-elf/property-and-1.s: Likewise. * testsuite/ld-elf/property-and-2.d: Likewise. * testsuite/ld-elf/property-and-2.s: Likewise. * testsuite/ld-elf/property-and-3.d: Likewise. * testsuite/ld-elf/property-and-3.s: Likewise. * testsuite/ld-elf/property-and-4.d: Likewise. * testsuite/ld-elf/property-and-empty.s: Likewise. * testsuite/ld-elf/property-or-1.d: Likewise. * testsuite/ld-elf/property-or-1.s: Likewise. * testsuite/ld-elf/property-or-2.d: Likewise. * testsuite/ld-elf/property-or-2.s: Likewise. * testsuite/ld-elf/property-or-3.d: Likewise. * testsuite/ld-elf/property-or-3.s: Likewise. * testsuite/ld-elf/property-or-4.d: Likewise. * testsuite/ld-elf/property-or-empty.s: Likewise.
2021-06-18sim: move -Werror disabling to MakefileMike Frysinger84-810/+971
For the ports that still don't build with -Werror, rather than disable the flag at configure time, do it at make time. This will allow us to unify these tests in the common sim configure script.
2021-06-18sim: create a makefile fragment to pass common settings downMike Frysinger9-3/+44
As we merge settings from subdirs into the common configure, we sometimes need to keep the settings working in both dirs. Create a makefile fragment to pass them down so we don't have to run the checks twice. For now, the file is empty, but we'll start moving logic in shortly.
2021-06-18gas: fold symbol table entries generated for .startof.() / .sizeof.()Jan Beulich5-8/+71
When the same such construct is used multiple times in a source file, there's still no need to emit a separate symbol each time. Under the assumption that there won't be many of these, use a simple array lookup method to record previously used symbols.
2021-06-18sim: split sim-signal.h include outMike Frysinger78-6/+169
The sim-basics.h is too big and includes too many things. This leads to some arch's sim-main.h having circular loop issues with defs, and makes it hard to separate out common objects from arch-specific defs. By splitting up sim-basics.h and killing off sim-main.h, it'll make it easier to separate out the two.
2021-06-18sim: drop core libiberty.h includeMike Frysinger2-2/+4
This doesn't need to be included for every sim file, so drop it. Every C file that needs it seems to already include it.
2021-06-17sim: overhaul & unify endian settings managementMike Frysinger151-1721/+348
The m4 macro has 2 args: the "wire" settings (which represents the hardwired port behavior), and the default settings (which are used if nothing else is specified). If none are specified, the arch is expected to support both, and the value will be probed based on the user runtime options or the input program. Only two arches today set the default value (bpf & mips). We can probably let this go as it only shows up in one scenario: the sim is invoked, but with no inputs, and no user endian selection. This means bpf will not behave like the other arches: an error is shown and forces the user to make a choice. If an input program is used though, we'll still switch the default to that. This allows us to remove the WITH_DEFAULT_TARGET_BYTE_ORDER setting. For the ports that set a "wire" endian, move it to the runtime init of the respective sim_open calls. This allows us to change the WITH_TARGET_BYTE_ORDER to purely a user-selected configure setting if they want to force a specific endianness. With all the endian logic moved to runtime selection, we can move the configure call up to the common dir so we only process it once across all ports. The ppc arch was picking the wire endian based on the target used, but since we weren't doing that for other biendian arches, we can let this go too. We'll rely on the input selecting the endian, or make the user decide.
2021-06-18Automatic date update in version.inGDB Administrator1-1/+1
2021-06-17sim: ppc: avoid "PAGE_SIZE" nameMike Frysinger3-4/+9
This define is used for a particular target and depends on the simulated CPU hardware. It has no relation to the host CPU that the sim is running on. So rename the common "PAGE_SIZE" here to better reflect its usage and avoid conflicts with system headers.
2021-06-17Don't call sigtimedwait for scoped_ignore_sigttouPedro Alves3-6/+24
Because SIGTTOU is sent to the whole process instead of to a specific thread, consuming a pending SIGTTOU in the destructor of scoped_ignore_sigttou could consume a SIGTTOU signal raised due to actions done by some other thread. Simply avoid sigtimedwait in scoped_ignore_sigttou, thus plugging the race. This works because we know that when the thread writes to the terminal and the signal is blocked, the kernel does not raise the signal at all. Tested on GNU/Linux, Solaris 11 and FreeBSD. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * scoped_ignore_signal.h (scoped_ignore_signal): Add ConsumePending template parameter. (scoped_ignore_signal::~scoped_ignore_signal): Skip calling sigtimedwait if ConsumePending is false. (scoped_ignore_sigpipe): Initialize with ConsumePending=true. * scoped_ignore_sigttou.h (scoped_ignore_sigttou) <m_ignore_signal>: Initialize with ConsumePending=false. Change-Id: I92f754dbc45c45819dce2ce68b8c067d8d5c61b1
2021-06-17x86-64: Use $NOPIE_LDFLAGS/$NOPIE_CFLAGS on protected-func-1H.J. Lu2-1/+8
PR ld/27973 * testsuite/ld-x86-64/x86-64.exp: Pass $NOPIE_LDFLAGS and $NOPIE_CFLAGS to protected-func-1 without PIE.
2021-06-17x86-64: Test protected function pointersH.J. Lu5-0/+122
On x86-64, function pointers in executable for external funtions may be resolved to their PLT entries in executable. If it happens, function pointers of protected funtions in shared libraries must be resolved to the PLT entries in executable, not addresses of protected funtions in shared libraries. PR ld/27973 * testsuite/ld-x86-64/x86-64.exp: Run protected function tests. * testsuite/ld-x86-64/protected-func-1.h: New file. * testsuite/ld-x86-64/protected-func-1a.s: Likewise. * testsuite/ld-x86-64/protected-func-1b.c: Likewise.
2021-06-17ld: Add ChangeLog entry for -no-pieFangrui Song1-0/+7
2021-06-17ld: Add -no-pieFangrui Song3-0/+11
gold has had this option for many years. Not having this option caused some confusion to users. The help message clarifies the default state. ld/ * ldlex.h (enum option_values): Add OPTION_NO_PIE. * lexsup.c (struct ld_options): Add -no-pie. (parse_args): Handle -no-pie. * ld.texi: Document -no-pie.
2021-06-17Add a unit test for scoped_ignore_sigpipePedro Alves3-0/+133
gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * Makefile.in (SELFTESTS_SRCS): Add unittests/scoped_ignore_signal-selftests.c. * unittests/scoped_ignore_signal-selftests.c: New. Change-Id: Idce24aa9432a3f1eb7065bc9aa030b1d0d7dcad5
2021-06-17scoped_ignore_signal: Use sigprocmask+sigtimedwait instead of signalPedro Alves2-2/+44
The problem with using signal(...) to temporarily ignore a signal, is that that changes the the signal disposition for the whole process. If multiple threads do it at the same time, you have a race. Fix this by using sigprocmask + sigtimedwait to implement the ignoring instead, if available, which I think probably means everywhere except Windows nowadays. This way, we only change the signal mask for the current thread, so there's no race. Change-Id: Idfe3fb08327ef8cae926f3de9ee81c56a83b1738 gdbsupport/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * scoped_ignore_signal.h (scoped_ignore_signal::scoped_ignore_signal) [HAVE_SIGPROCMASK]: Use sigprocmask to block the signal instead of changing the signal disposition for the whole process. (scoped_ignore_signal::~scoped_ignore_signal) [HAVE_SIGPROCMASK]: Use sigtimedwait and sigprocmask to flush and unblock the signal.
2021-06-17Introduce scoped_restore_signalPedro Alves4-40/+120
We currently have scoped_restore_sigttou and scoped_restore_sigpipe doing basically the same thing -- temporarily ignoring a specific signal. This patch introduce a scoped_restore_signal type that can be used for both. This will become more important for the next patch which changes how the signal-ignoring is implemented. scoped_restore_sigpipe is a straight alias to scoped_restore_signal<SIGPIPE> on systems that define SIGPIPE, and an alias to scoped_restore_signal_nop (a no-op version of scoped_restore_signal) otherwise. scoped_restore_sigttou is not a straight alias because it wants to check the job_control global. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * gdbsupport/scoped_ignore_signal.h: New. * compile/compile.c: Include gdbsupport/scoped_ignore_signal.h instead of <signal.h>. Don't include <unistd.h>. (scoped_ignore_sigpipe): Remove. * gdbsupport/scoped_ignore_sigttou.h: Include gdbsupport/scoped_ignore_signal.h instead of <signal.h>. Don't include <unistd.h>. (lazy_init): New. (scoped_ignore_sigttou): Reimplement using scoped_ignore_signal and lazy_init. Change-Id: Ibb44d0bd705e96df03ef0787c77358a4a7b7086c
2021-06-17Move scoped_ignore_sigttou to gdbsupport/Pedro Alves8-9/+18
A following patch will want to use scoped_ignore_sigttou in code shared between GDB and GDBserver. Move it under gdbsupport/. Note that despite what inflow.h/inflow.c's first line says, inflow.c is no longer about ptrace, it is about terminal management. Some other files were unnecessarily including inflow.h, I guess a leftover from the days when inflow.c really was about ptrace. Those inclusions are simply dropped. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * Makefile.in (HFILES_NO_SRCDIR): Remove inflow.h. * inf-ptrace.c, inflow.c, procfs.c: Don't include "inflow.h". * inflow.h: Delete, moved to gdbsupport/ under a different name. * ser-unix.c: Don't include "inflow.h". Include "gdbsupport/scoped_ignore_sigttou.h". gdbsupport/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * scoped_ignore_sigttou.h: New file, moved from gdb/ and renamed. Change-Id: Ie390abf42c3a78bec6d282ad2a63edd3e623559a
2021-06-17Fix an assertion failure in the AArch64 assembler triggered by incorrect ↵Nick Clifton5-3/+24
instruction syntax. PR 27904 * config/tc-aarch64.c (ldst_lo12_determine_real_reloc_type): Generate a syntax error message if the reloc qualifier does not match the instruction's size.
2021-06-17gas: handle csect in bss section for XCOFFClément Chigot2-3/+14
Latest gcc versions are now generating csects instead of .lcomm for bss symbols. Some adjustements are needed in order to handle them. * config/tc-ppc.c (md_begin): Create bss section with dummy symbol. (ppc_frob_symbol): Output XTY_CM for bss csects. (ppc_fix_adjustable): Adjust condition to avoid bss csects.
2021-06-17gdb/testsuite: gdb.base/args.exp: add KFAIL for native-extended-gdbserverSimon Marchi2-5/+23
This test tests passing arguments made of exactly two single-quotes ('') or a single newline character through the --args argument of GDB. For some reason, GDB adds some extra single quotes when transmitting the arguments to GDBserver. This produces some FAILs when testing with the native-extended-gdbserver board: FAIL: gdb.base/args.exp: argv[2] for one empty (with single quotes) FAIL: gdb.base/args.exp: argv[2] for two empty (with single quotes) FAIL: gdb.base/args.exp: argv[3] for two empty (with single quotes) FAIL: gdb.base/args.exp: argv[2] for one newline FAIL: gdb.base/args.exp: argv[2] for two newlines FAIL: gdb.base/args.exp: argv[3] for two newlines This is documented as PR 27989. Add some appropriate KFAILs. gdb/testsuite/ChangeLog: * gdb.base/args.exp: Check target, KFAIL if remote. (args_test): Add parameter and use it. Change-Id: I49225d1c7df7ebaba480ebdd596df80f8fbf62f0
2021-06-17gdb/testsuite: gdb.base/args.exp: remove trailing parenthesis in test namesSimon Marchi2-2/+6
Some test names end with a parenthesis, we don't want that: https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages Fix that. gdb/testsuite/ChangeLog: * gdb.base/args.exp: Remove trailing parenthesis in test names. Change-Id: I0306ea202bae3a4ed5bf0bd65e0ab5ed5de52fe1
2021-06-17gdb/testsuite: gdb.base/args.exp: use $old_gdbflags last two testsSimon Marchi2-2/+6
All tests in this file append to GDBFLAGS instead of overwriting it, except the last two. I noticed because when testing with the native-extended-remote board, it removes the "set sysroot" argument, and it causes the test to be very long to run, due to big glibc debug info being read through the remote target. I think this oddity is due to a race condition between these two commits: [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c22261528c50f7760dd6a2e29314662b377eebb4 [2] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6b8ce727297b1e40738e50f83a75881b290fe6a6 The first one added the two tests. The second one changes the test to append to GDBFLAGS instead of overwriting it. But the second one was probably written before the first one was it, so missed the new tests. Change those two tests to be like the others. gdb/testsuite/ChangeLog: * gdb.base/args.exp: Use $old_gdbflags in all tests. Change-Id: I531276125ecb70e80f52adbd320ebb85b0c8eba0
2021-06-17gdb/testsuite: gdb.base/args.exp: use save_varsSimon Marchi2-29/+31
Use save_vars instead of manually saving/restoring. This ensures that if anything throws an error, GDBFLAGS will be correctly restored. Remove the global GDBFLAGS declaration at the top, it's not necessary. gdb/testsuite/ChangeLog: * gdb.base/args.exp: Use save_vars. Change-Id: I3a45e4fc1635ec0212de2415040f91eecaf4a057
2021-06-17Make the TUI command window support the mousePedro Alves4-52/+186
Currently, when the focus is on the command window, we disable the keypad. This means that when the command window has the focus, keys such as up/down/home/end etc. are not processed by curses, and their escape sequences go straight to readline. A side effect of disabling keypad mode is that wgetch no longer processes mouse escape sequences, with the end result being the mouse doesn't work, and worse, the raw mouse escape sequences are printed on the terminal. This commit makes the TUI command window support the mouse as well, by always enabling the keypad, and then to avoid losing support for up/down browsing the command history, home/end/left/right moving the cursor position, etc., we forward those keys as raw escape sequences to readline. Note we don't make an effort to pass down to readline all keys returned by curses, only the common ones that readline understands by default. Given users can specify their own readline bindings (inputrc file, bind utility), this approach is good in practice, though not 100% transparent or perfect. Note that the patch makes it so that CTLC-L is always passed to readline even if the command window does not have the focus. It was simpler to implement that way, and it just seems correct to me. I don't know of a reason we shouldn't do that. The patch improves the TUI behavior in a related way. Now we can pass special keys to readline irrespective of which window has the focus. First, we try to dispatch the key to a window, via tui_displatch_ctrl_char. If the key is dispatched, then we don't pass it to readline. E.g., pressing "up" when you have the source window in focus results in scrolling the source window, and nothing else. If however, you press ctrl-del instead, that results in killing the next word in the command window, no matter which window has has focus. Before, it would only work if you had the command window in focus. Similarly, ctrl-left/ctrl-right to move between words, etc. Similarly, the previous spot where we handled mouse events was incorrect. It was never reached if the window with focus can't scroll, which is the case for the command window. Mouse scrolling affects the window under the mouse cursor, not the window in focus. We now always try to dispatch mouse events. One last bit in the patch -- now if we don't recognize the non-8-bit curses key, then we don't pass it down to readline at all. Before that would result in bogus characters in the input line. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * tui/tui-io.c (tui_dispatch_mouse_event): New, factored out from ... (tui_dispatch_ctrl_char): ... this. Move CTRL-L handling to tui_getc_1. (cur_seq, start_sequence): New. (tui_getc_1): Pass key escape sequences for curses control keys to readline. Handle mouse and ctrl-l here. (tui_resize_all): Disable/reenable the keypad if the command window has the focus too. * tui/tui-win.c (tui_set_focus_command): Don't change keypad setting. * tui/tui.c (tui_rl_other_window): Don't change keypad setting. Change-Id: Ie0a7d849943cfb47f4a6589e1c73341563740fa9
2021-06-17gas: ensure sections contents is zero for BFD_RELOC_PPC*_TLSM on XCOFF.Clément Chigot6-5/+107
AIX ld expects the section contents for relocations BFD_RELOC_PPC_TLSM or BFD_RELOC_PPC64_TLSM to be zero. Actually, it seems to be the case for all the TLS relocations generated by AIX assembly but only these two are mandatory. * config/tc-ppc.c (md_apply_fix): Adjust addend to nullify section contents for BFD_RELOC_PPC_TLSM or BFD_RELOC_PPC64_TLSM. * testsuite/gas/ppc/xcoff-tlsm-32.d: New test. * testsuite/gas/ppc/xcoff-tlsm-64.d: New test. * testsuite/gas/ppc/xcoff-tlsm.s: New test. * testsuite/gas/ppc/aix.exp: Run new tests.