aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-09Binutils: Pass --plugin to AR and RANLIBH.J. Lu14-14/+203
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. libctf/ * configure: Regenerated. opcodes/ * configure: Regenerated.
2021-01-09GCC: Pass --plugin to AR and RANLIBH.J. Lu15-9/+219
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. * Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. * configure.ac: Include config/gcc-plugin.m4. AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and RANLIB if possible. * Makefile.in: Regenerated. * configure: Likewise. config/ * gcc-plugin.m4 (GCC_PLUGIN_OPTION): New. libiberty/ * Makefile.in (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. (configure_deps): Depend on ../config/gcc-plugin.m4. * aclocal.m4: Include ../config/gcc-plugin.m4. * configure.ac: AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * configure: Regenerated. zlib/ * configure: Regenerated.
2021-01-09sim: replace rindex with strrchrMike Frysinger2-2/+6
2021-01-09sim: cr16/d10v: move storage out of headerMike Frysinger6-2/+20
These ports declare their State variable in a header and then include multiple times. This causes linker errors with newer gcc due to the change in -fno-common behavior. Move the storage to a C file so we only have one instance of it in the final program.
2021-01-09sim: common: clean up asprintf includes a bitMike Frysinger4-5/+7
Delete stale prototypes that libiberty.h already provides, and add missing libiberty.h includes to files that use those functions.
2021-01-09sim: sh64: delete portMike Frysinger430-73941/+13
Support for sh64 was dropped from bfd et al in 2018. Without that, the sim port is useless. So clean up this code too.
2021-01-09sim: clean up stale AC_PREREQ refsMike Frysinger61-458/+198
This was purged from the tree when we upgraded to autoconf-2.69, but a few references in the sim tree were missed.
2021-01-09sim: enable -Werror by default for some archesMike Frysinger53-116/+140
We've had this off for a long time because the sim code was way too full of warnings for it to be feasible. However, I've cleaned things up significantly from when this was first merged, and we can start to turn this around. Change the macro to enable -Werror by default, and allow ports to opt out. New ports will get it automatically (and we can push back on them if they try to turn it off). Also turn it off for the few ports that still hit warnings for me. All the rest will get the new default, and we'll wait for feedback if/when new issues come up.
2021-01-09ld/x86-64: Properly Handle -z lam-u48/lam-u57H.J. Lu6-2/+55
Properly merge GNU properties for LAM_U48 and LAM_U57. bfd/ PR ld/27166 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle -z lam-u48 and -z lam-u57. ld/ PR ld/27166 * testsuite/ld-x86-64/lam-u48.rd: New file. * testsuite/ld-x86-64/lam-u57.rd: Likewise. * testsuite/ld-x86-64/x86-64.exp: Add PR ld/27166 tests.
2021-01-09sim: pru: fix include ordering with sim-main.hMike Frysinger2-0/+6
Make sure config.h is included before C library headers otherwise the later libiberty.h include gets confused about asprintf state leading to warnings like: common/sim-utils.c:330:9: warning: implicit declaration of function 'vasprintf'; did you mean 'xvasprintf'? [-Wimplicit-function-declaration]
2021-01-09sim: hw: rework code to avoid gcc warningsMike Frysinger2-7/+8
Newer gcc thinks we might return a pointer to a stack buffer, but we don't -- we strdup it before returning. Rework the code to just malloc the buffer from the start and avoid the stack+strdup.
2021-01-09Update release howto with 2.37 numbersNick Clifton1-17/+20
2021-01-09Change version number to 2.36.50 and regenerate filesNick Clifton19-5304/+5649
2021-01-09Add Changelog entries and NEWS entries for 2.36 branchNick Clifton18-1/+61
2021-01-09sim: common: add missing stdlib.h for abort()Mike Frysinger5-0/+9
2021-01-08ld/x86-64: Also set LAM_U57 when setting LAM_U48H.J. Lu5-4/+16
Since LAM_U48 implies LAM_U57, also set LAM_U57 when setting LAM_U48. bfd/ * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Also set LAM_U57 when setting LAM_U48. ld/ * ld-x86-64/property-x86-lam-u48-4.d: Updated. * ld-x86-64/property-x86-lam-u48-5.d: Likewise.
2021-01-08elf: Verify section size for mixed ordered/unordered inputsH.J. Lu2-0/+15
When fixing up SHF_LINK_ORDER, issue a fatal error if the output section size is increased. Otherwise, bfd_set_section_contents will fail later when attempting to write contents past the end of the output section. PR ld/26256 PR ld/27160 * elflink.c (elf_fixup_link_order): Verify that fixing up SHF_LINK_ORDER doesn't increase the output section size.
2021-01-09POWER10: Add Return-Oriented Programming instructionsPeter Bergner9-1/+148
POWER10 adds some return-oriented programming (ROP) instructions and this patch adds support for them. You will notice that they are enabled for POWER8 and later, not just POWER10 and later. This is on purpose. This allows the instructions to be added to POWER8 binaries that can be run on POWER8, POWER9 and POWER10 cpus. On POWER8 and POWER9, these instructions just act as nop's. opcodes/ * ppc-opc.c (insert_dw, (extract_dw): New functions. (DW, (XRC_MASK): Define. (powerpc_opcodes) <hashchk, hashchkp, hashst, haststp>: New mnemonics. gas/ * testsuite/gas/ppc/rop-checks.d, * testsuite/gas/ppc/rop-checks.l, * testsuite/gas/ppc/rop-checks.s, * testsuite/gas/ppc/rop.d, * testsuite/gas/ppc/rop.s: New tests. * testsuite/gas/ppc/ppc.exp: Run them.
2021-01-09configure regenAlan Modra16-28/+46
commit f478212851 did the regen by hand, missed a change in ld/configure and didn't update line numbers. Fix that, and an old regen of ld/Makefile.in with the wrong automake. bfd/ * configure: Regenerate. binutils/ * configure: Regenerate. gas/ * configure: Regenerate. gprof/ * configure: Regenerate. ld/ * Makefile.in: Regenerate. * configure: Regenerate. libctf/ * configure: Regenerate. opcodes/ * configure: Regenerate. zlib/ * configure: Regenerate.
2021-01-09Automatic date update in version.inGDB Administrator1-1/+1
2021-01-08sim: require a C11 compilerMike Frysinger65-419/+1750
With GDB requiring a C++11 compiler now, this hopefully shouldn't be a big deal. It's been 10 years since C11 came out, so should be plenty of time to upgrade. This will allow us to start cleaning up random header logic and many of our non-standard custom types.
2021-01-08Pass void_context_p to parse_expressionTom Tromey9-9/+156
An earlier patch pointed out that nothing in GDB sets void_context_p when parsing an expression. This patch fixes this omission. "print" and "call" differ in that the former will print a value that has void type, while the latter will not. AdaCore has had a patch for a long time that uses this distinction to help with overload resolution. In particular, in a "call" context, a procedure will be chosen, while in a "print" context, a zero-argument function will be chosen instead. Regression tested on x86-64 Fedora 32. gdb/ChangeLog 2021-01-08 Tom Tromey <tromey@adacore.com> * parse.c (parse_expression): Add void_context_p parameter. Use parse_exp_in_context. * printcmd.c (print_command_1): Change voidprint to bool. Pass to parse_expression. (print_command, call_command): Update. * expression.h (parse_expression): Add void_context_p parameter. gdb/testsuite/ChangeLog 2021-01-08 Tom Tromey <tromey@adacore.com> * gdb.ada/voidctx/pck.adb: New file. * gdb.ada/voidctx/pck.ads: New file. * gdb.ada/voidctx/voidctx.adb: New file. * gdb.ada/voidctx.exp: New file.
2021-01-08gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dirSimon Marchi4-7/+90
As reported in PR 27157, if some environment variables read at startup by GDB are defined but empty, we hit the assert in gdb_abspath: $ XDG_CACHE_HOME= ./gdb -nx --data-directory=data-directory -q AddressSanitizer:DEADLYSIGNAL ================================================================= ==2007040==ERROR: AddressSanitizer: SEGV on unknown address 0x0000000001b0 (pc 0x5639d4aa4127 bp 0x7ffdac232c00 sp 0x7ffdac232bf0 T0) ==2007040==The signal is caused by a READ memory access. ==2007040==Hint: address points to the zero page. #0 0x5639d4aa4126 in target_stack::top() const /home/smarchi/src/binutils-gdb/gdb/target.h:1334 #1 0x5639d4aa41f1 in inferior::top_target() /home/smarchi/src/binutils-gdb/gdb/inferior.h:369 #2 0x5639d4a70b1f in current_top_target() /home/smarchi/src/binutils-gdb/gdb/target.c:120 #3 0x5639d4b00591 in gdb_readline_wrapper_cleanup::gdb_readline_wrapper_cleanup() /home/smarchi/src/binutils-gdb/gdb/top.c:1046 #4 0x5639d4afab31 in gdb_readline_wrapper(char const*) /home/smarchi/src/binutils-gdb/gdb/top.c:1104 #5 0x5639d4ccce2c in defaulted_query /home/smarchi/src/binutils-gdb/gdb/utils.c:893 #6 0x5639d4ccd6af in query(char const*, ...) /home/smarchi/src/binutils-gdb/gdb/utils.c:985 #7 0x5639d4ccaec1 in internal_vproblem /home/smarchi/src/binutils-gdb/gdb/utils.c:373 #8 0x5639d4ccb3d1 in internal_verror(char const*, int, char const*, __va_list_tag*) /home/smarchi/src/binutils-gdb/gdb/utils.c:439 #9 0x5639d5151a92 in internal_error(char const*, int, char const*, ...) /home/smarchi/src/binutils-gdb/gdbsupport/errors.cc:55 #10 0x5639d5162ab4 in gdb_abspath(char const*) /home/smarchi/src/binutils-gdb/gdbsupport/pathstuff.cc:132 #11 0x5639d5162fac in get_standard_cache_dir[abi:cxx11]() /home/smarchi/src/binutils-gdb/gdbsupport/pathstuff.cc:228 #12 0x5639d3e76a81 in _initialize_index_cache() /home/smarchi/src/binutils-gdb/gdb/dwarf2/index-cache.c:325 #13 0x5639d4dbbe92 in initialize_all_files() /home/smarchi/build/binutils-gdb/gdb/init.c:321 #14 0x5639d4b00259 in gdb_init(char*) /home/smarchi/src/binutils-gdb/gdb/top.c:2344 #15 0x5639d4440715 in captured_main_1 /home/smarchi/src/binutils-gdb/gdb/main.c:950 #16 0x5639d444252e in captured_main /home/smarchi/src/binutils-gdb/gdb/main.c:1229 #17 0x5639d44425cf in gdb_main(captured_main_args*) /home/smarchi/src/binutils-gdb/gdb/main.c:1254 #18 0x5639d3923371 in main /home/smarchi/src/binutils-gdb/gdb/gdb.c:32 #19 0x7fa002d3f0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #20 0x5639d392314d in _start (/home/smarchi/build/binutils-gdb/gdb/gdb+0x4d414d) gdb_abspath doesn't handle empty strings, so handle this case in the callers. If a variable is defined but empty, I think it's reasonable in this case to just ignore it, as if it was not defined. Note that this sometimes also lead to a segfault, because the failed assertion happens very early during startup, before things are fully initialized. gdbsupport/ChangeLog: PR gdb/27157 * pathstuff.cc (get_standard_cache_dir, get_standard_config_dir, find_gdb_home_config_file): Add empty string check. gdb/testsuite/ChangeLog: PR gdb/27157 * gdb.base/empty-host-env-vars.exp: New test. Change-Id: I8654d8e97e74e1dff6d308c111ae4b1bbf07bef9
2021-01-08gdb: add missing test for completion of invalid /FMT stringsAndrew Burgess2-0/+9
This commit: commit 3df8c6afdd6d38a7622ff5f4b1a64aff80334ab9 Date: Fri Nov 27 10:46:07 2020 +0000 gdb: fix potentially uninitialised variable Was pushed with no test. Naughty! The new test checks how GDB behaves when completing an invalid /FMT string. Currently GDB does no validation of the /FMT string during tab completion, and just assumes that any /FMT string is valid and complete when the user hits TAB. So: (gdb) p/@@<TAB> Will give: (gdb) p/@@ <CURSOR IS HERE> We already had a test in place for completion on a valid /FMT string, but the above commit fixed a bug in the logic for completing invalid /FMT strings. Now we have a test for this too. gdb/testsuite/ChangeLog: * gdb.base/completion.exp: Add a new test.
2021-01-08Updated Swedish translation for the opcodes/ subdirectoryNick Clifton2-280/+353
2021-01-08gdb: user variables with components of dynamic typeAndrew Burgess5-2/+174
Consider this Fortran type: type :: some_type integer, allocatable :: array_one (:,:) integer :: a_field integer, allocatable :: array_two (:,:) end type some_type And a variable declared: type(some_type) :: some_var Now within GDB we try this: (gdb) set $a = some_var (gdb) p $a $1 = ( array_one = ../../src/gdb/value.c:3968: internal-error: Unexpected lazy value type. Normally, when an internalvar ($a in this case) is created, it is non-lazy, the value is immediately copied out of the inferior into GDB's memory. When printing the internalvar ($a) GDB will extract each field in turn, so in this case `array_one`. As the original internalvar is non-lazy then the extracted field will also be non-lazy, with its contents immediately copied from the parent internalvar. However, when the field has a dynamic type this is not the case, in value_primitive_field we see that any field with dynamic type is always created lazy. Further, the content of this field will usually not have been captured in the contents buffer of the original value, a field with dynamic location is effectively a pointer value contained within the parent value, with rules in the DWARF for how to dereference the pointer. So, we end up with a lazy lval_internalvar_component representing a field within an lval_internalvar. This eventually ends up in value_fetch_lazy, which currently does not support lval_internalvar_component, and we see the error above. My original plan for how to handle this involved extending value_fetch_lazy to handle lval_internalvar_component. However, when I did this I ran into another error: (gdb) set $a = some_var (gdb) p $a $1 = ( array_one = ((1, 1) (1, 1) (1, 1)), a_field = 5, array_two = ((0, 0, 0) (0, 0, 0)) ) (gdb) p $a%array_one $2 = ((1, 1) (1, 1) (1, 1)) (gdb) p $a%array_one(1,1) ../../src/gdb/value.c:1547: internal-error: void set_value_address(value*, CORE_ADDR): Assertion `value->lval == lval_memory' failed. The problem now is inside set_value_component_location, where we attempt to set the address for a component if the original parent value has a dynamic location. GDB does not expect to ever set the address on anything other than an lval_memory value (which seems reasonable). In order to resolve this issue I initially thought about how an internalvar should "capture" the value of a program variable at the moment the var is created. In an ideal world (I think) GDB would be able to do this even for values with dynamic type. So in our above example doing `set $a = some_var` would capture the content of 'some_var', but also the content of 'array_one', and also 'array_two', even though these content regions are not contained within the region of 'some_var'. Supporting this would require GDB values to be able to carry around multiple non-contiguous regions of memory as content in some way, which sounds like a pretty huge change to a core part of GDB. So, I wondered if there was some other solution that wouldn't require such a huge change. What if values with a dynamic location were though of like points with automatic dereferencing? Given this C structure: struct foo_t { int *val; } struct foo_t my_foo; Then in GDB: (gdb) $a = my_foo We would expect GDB to capture the pointer value in '$a', but not the value pointed at by the pointer. So maybe it's not that unreasonable to think that given a dynamically typed field GDB will capture the address of the content, but not the actual content itself. That's what this patch does. The approach is to catch this case in set_value_component_location. When we create a component location (of an lval_internalvar) that has a dynamic data location, the lval_internalvar_component is changed into an lval_memory. After this, both of the above issues are resolved. In the first case, the lval_memory is still lazy, but value_fetch_lazy knows how to handle that. In the second case, when we access an element of the array we are now accessing an element of an lval_memory, not an lval_internalvar_component, and calling set_value_address on an lval_memory is fine. gdb/ChangeLog: * value.c (set_value_component_location): Adjust the VALUE_LVAL for internalvar components that have a dynamic location. gdb/testsuite/ChangeLog: * gdb.fortran/intvar-dynamic-types.exp: New file. * gdb.fortran/intvar-dynamic-types.f90: New file.
2021-01-08Fix places in the AArch64 opcodes library code where a call to assert() has ↵Nick Clifton3-7/+16
side effects. PR 27129 * aarch64-dis.c (determine_disassembling_preference): Move call to aarch64_match_operands_constraint outside of the assertion. * aarch64-asm.c (aarch64_ins_limm_1): Remove call to assert. Replace with a return of FALSE.
2021-01-08Treat the AArch64 register id_aa64mmfr2_el1 as a core system register.Nick Clifton2-1/+7
PR 27139 * aarch64-opc.c (aarch64_sys_regs): Treat id_aa64mmfr2_el1 as a core system register.
2021-01-08[gdb] Fix internal-error in process_event_stop_testTom de Vries2-65/+110
The function create_exception_master_breakpoint in gdb/breakpoint.c attempts to set a master exception breakpoint in each objfile. It tries this using a libgcc/unwind probe, and if that fails then using the _Unwind_DebugHook symbol: ... for (objfile *objfile : current_program_space->objfiles ()) { /* Try using probes. */ if (/* successful */) continue; /* Try using _Unwind_DebugHook */ } ... The preference scheme works ok both if the objfile has debug info, and if it's stripped. But it doesn't work when the objfile has a .gnu_debuglink to a .debug file (and the .debug file is present). What happens is that: - we first encounter objfile libgcc.debug - we try using probes, and this fails - so we try _Unwind_DebugHook, which succeeds - next we encounter objfile libgcc - we try using probes, and this succeeds. So, we end up with a master exception breakpoint in both libgcc (using probes) and libgcc.debug (using _Unwind_DebugHook). This eventually causes: ... (gdb) PASS: gdb.cp/nextoverthrow.exp: post-check - next over a throw 3 next^M src/gdb/infrun.c:6384: internal-error: \ void process_event_stop_test(execution_control_state*): \ Assertion `ecs->event_thread->control.exception_resume_breakpoint != NULL' \ failed.^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M Quit this debugging session? (y or n) FAIL: gdb.cp/nextoverthrow.exp: next past catch (GDB internal error) ... To trigger this internal-error, we need to use gcc-10 or later to compile the test-case, such that it contains the fix for gcc PR97774 - "Incorrect line info for try/catch". Fix this by only trying to install the master exception breakpoint in libgcc.debug using the _Unwind_DebugHook method, if the install using probes in libgcc failed. Tested on x86_64-linux. gdb/ChangeLog: 2021-01-08 Tom de Vries <tdevries@suse.de> PR gdb/26881 * breakpoint.c (create_exception_master_breakpoint_probe) (create_exception_master_breakpoint_hook): Factor out of ... (create_exception_master_breakpoint): ... here. Only try to install the master exception breakpoint in objfile.debug using the _Unwind_DebugHook method, if the install using probes in objfile failed.
2021-01-08gdb/fortran: Correct the lval type for array elements of internal varsAndrew Burgess5-5/+97
Since this commit: commit a5c641b57b0b5e245b8a011cccc93a4120c8bd63 Date: Thu Oct 8 16:45:59 2020 +0100 gdb/fortran: Add support for Fortran array slices at the GDB prompt A bug was introduced into GDB. Consider this Fortan array: integer, dimension (1:10) :: array array = 1 Now inside GDB: (gdb) set $var = array (gdb) set $var(1) = 2 Left operand of assignment is not an lvalue. The problem is that the new code for slicing Fortran arrays now does not set the lval type correctly for arrays that are not in memory. This is easily fixed by making use of value_from_component. After this the above example behaves as you'd expect. gdb/ChangeLog: * f-lang.c (fortran_value_subarray): Call value_from_component. gdb/testsuite/ChangeLog: * gdb.fortran/intvar-array.exp: New file. * gdb.fortran/intvar-array.f90: New file.
2021-01-08sim: ppc: stub out sim_memory_mapMike Frysinger2-0/+10
Not clear how to implement this in the ppc-specific sim, so just stub it out. This is as good as it was previously.
2021-01-08Automatic date update in version.inGDB Administrator1-1/+1
2021-01-07sim: ChangeLog: move arch-specific entries into the arch dirMike Frysinger10-509/+524
We don't want arch-specific entries in the common ChangeLog files. Most arches do this already, so clean up the recent additions, and move some older entries down to help avoid confusing newcomers.
2021-01-07sim: cris: disable test that crashes the linkerMike Frysinger2-1/+10
PR ld/13900 Linking this test crashes the linker, so disable it. The crash was reported about 9 years ago but haven't made progress, so lets avoid the failures in test runs.
2021-01-07sim: cris: use -sim with C tests for cris-elf targetsMike Frysinger2-0/+8
Building the C tests with a cris-elf toolchain (gcc-10.2 & newlib-4.1.0) currently fail due to warnings it emits: cris-elf-ld: libc.a(lib_a-closer.o): in function `_close_r': newlib/libc/reent/closer.c:47: warning: _close is not implemented and will always fail This is because the default target for cris-elf is bare metal, not the simulator. For that, we need -sim. So add it for elf targets. We don't add it for all targets as the simulator (and testsuite) run both libgloss programs as well as Linux userspace programs.
2021-01-07sim: h8300: delete opcode cachingMike Frysinger3-136/+20
This is in preparation for converting h8300 over to the common memory framework. It's not clear how much of a speed gain this was providing in the first place -- a naive test of ~400k insns (using shlr.s) shows that this code actually slowed things down a bit. If anyone really cares about h8300 anymore, they can migrate to the common insn caching logic.
2021-01-07gdb/sim: add support for exporting memory mapMike Frysinger6-0/+98
This allows gdb to quickly dump & process the memory map that the sim knows about. This isn't fully accurate, but is largely limited by the gdb memory map format. While the sim supports RWX bits, gdb can only handle RW or RO regions.
2021-01-07libtool.m4: update GNU/Hurd test from upstream. In upstream libtool, ↵Samuel Thibault17-99/+41
47a889a4ca20 ("Improve GNU/Hurd support.") fixed detection of shlibpath_overrides_runpath, thus avoiding unnecessary relink. This backports it. . * libtool.m4: Match gnu* along other GNU systems. */ChangeLog: * configure: Re-generate.
2021-01-07Updated French translation for the opcodes/ subdirectory.Nick Clifton2-242/+317
2021-01-07ELF: Don't generate unused section symbolsH.J. Lu162-522/+809
For ELF targets, section symbols are required only for relocations. With -ffunction-sections -fdata-sections, there can be many unused section symbols. Sizes of libstdc++.a on Linux/x86-64 in GCC 11 are With unused section symbols : 39411698 bytes Without unused section symbols: 39227002 bytes The unused section symbols in libstdc++.a occupy more than 180 KB. Add BSF_SECTION_SYM_USED to indicate if a section symbol should be included in the symbol table. The BSF_SECTION_SYM_USED should be set if the section symbol is used for relocation or the section symbol is always included in the symbol table. Add keep_unused_section_symbols to bfd_target to indicate if unused section symbols should be kept. If TARGET_KEEP_UNUSED_SECTION_SYMBOLS is defined as FALSE, unused ection symbols will be removed. Tested on Linux/x86. Other ELF backends need to: 1. Define TARGET_KEEP_UNUSED_SECTION_SYMBOLS to FALSE. 2. Mark used section symbols in assembler backend. 3. Remove unused section symbols from expected assembler and linker outputs. bfd/ PR 27109 * aix386-core.c (core_aix386_vec): Initialize keep_unused_section_symbol to TARGET_KEEP_UNUSED_SECTION_SYMBOLS. * aout-target.h (MY (vec)): Likewise. * binary.c (binary_vec): Likewise. * cisco-core.c (core_cisco_be_vec): Likewise. (core_cisco_le_vec): Likewise. * coff-alpha.c (alpha_ecoff_le_vec): Likewise. * coff-i386.c (TARGET_SYM): Likewise. (TARGET_SYM_BIG): Likewise. * coff-ia64.c (TARGET_SYM): Likewise. * coff-mips.c (mips_ecoff_le_vec): Likewise. (mips_ecoff_be_vec): Likewise. (mips_ecoff_bele_vec): Likewise. * coff-rs6000.c (rs6000_xcoff_vec): Likewise. (powerpc_xcoff_vec): Likewise. * coff-sh.c (sh_coff_small_vec): Likewise. (sh_coff_small_le_vec): Likewise. * coff-tic30.c (tic30_coff_vec): Likewise. * coff-tic54x.c (tic54x_coff0_vec): Likewise. (tic54x_coff0_beh_vec): Likewise. (tic54x_coff1_vec): Likewise. (tic54x_coff1_beh_vec): Likewise. (tic54x_coff2_vec): Likewise. (tic54x_coff2_beh_vec): Likewise. * coff-x86_64.c (TARGET_SYM): Likewise. (TARGET_SYM_BIG): Likewise. * coff64-rs6000.c (rs6000_xcoff64_vec): Likewise. (rs6000_xcoff64_aix_vec): Likewise. * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): Likewise. (CREATE_BIGHDR_COFF_TARGET_VEC): Likewise. (CREATE_LITTLE_COFF_TARGET_VEC): Likewise. * elfxx-target.h (TARGET_BIG_SYM): Likewise. (TARGET_LITTLE_SYM): Likewise. * hppabsd-core.c (core_hppabsd_vec): Likewise. * hpux-core.c (core_hpux_vec): Likewise. * i386msdos.c (i386_msdos_vec): Likewise. * ihex.c (ihex_vec): Likewise. * irix-core.c (core_irix_vec): Likewise. * mach-o-target.c (TARGET_NAME): Likewise. * mmo.c (mmix_mmo_vec): Likewise. * netbsd-core.c (core_netbsd_vec): Likewise. * osf-core.c (core_osf_vec): Likewise. * pdp11.c (MY (vec)): Likewise. * pef.c (pef_vec): Likewise. (pef_xlib_vec): Likewise. * plugin.c (plugin_vec): Likewise. * ppcboot.c (powerpc_boot_vec): Likewise. * ptrace-core.c (core_ptrace_vec): Likewise. * sco5-core.c (core_sco5_vec): Likewise. * som.c (hppa_som_vec): Likewise. * srec.c (srec_vec): Likewise. (symbolsrec_vec): Likewise. * tekhex.c (tekhex_vec): Likewise. * trad-core.c (core_trad_vec): Likewise. * verilog.c (verilog_vec): Likewise. * vms-alpha.c (alpha_vms_vec): Likewise. * vms-lib.c (alpha_vms_lib_txt_vec): Likewise. * wasm-module.c (wasm_vec): Likewise. * xsym.c (sym_vec): Likewise. * elf.c (ignore_section_sym): Return TRUE if BSF_SECTION_SYM_USED isn't set. (elf_map_symbols): Don't include ignored section symbols. * elfcode.h (elf_slurp_symbol_table): Also set BSF_SECTION_SYM_USED on STT_SECTION symbols. * elflink.c (bfd_elf_final_link): Generated section symbols only when emitting relocations or reqired. * elfxx-x86.h (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New. * syms.c (BSF_SECTION_SYM_USED): New. * targets.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New. (bfd_target): Add keep_unused_section_symbols. (bfd_keep_unused_section_symbols): New. * bfd-in2.h: Regenerated. binutils/ PR 27109 * objcopy.c (copy_object): Handle section symbols for non-relocatable inputs. * testsuite/binutils-all/readelf.exp (readelf_test): Check is_elf_unused_section_symbols. * testsuite/binutils-all/readelf.s-64: Updated. * testsuite/binutils-all/readelf.ss: Likewise. * testsuite/binutils-all/readelf.ss-64: Likewise. * testsuite/binutils-all/readelf.s-64-unused: New file. * testsuite/binutils-all/readelf.ss-64-unused: Likewise. * testsuite/binutils-all/readelf.ss-unused: Likewise. * testsuite/lib/binutils-common.exp (is_elf_unused_section_symbols): New proc. gas/ChangeLog: PR 27109 * read.c (s_reloc): Call symbol_mark_used_in_reloc on the section symbol. * subsegs.c (subseg_set_rest): Set BSF_SECTION_SYM_USED if needed. * write.c (adjust_reloc_syms): Call symbol_mark_used_in_reloc on the section symbol. (set_symtab): Don't generate unused section symbols. (maybe_generate_build_notes): Call symbol_mark_used_in_reloc on the section symbol. * config/obj-elf.c (elf_adjust_symtab): Call symbol_mark_used_in_reloc on the group signature symbol. * testsuite/gas/cfi/cfi-label.d: Remove unused section symbols from expected output. * testsuite/gas/elf/elf.exp (run_elf_list_test): Check is_elf_unused_section_symbols. * testsuite/gas/elf/section2.e: Updated. * testsuite/gas/elf/section2.e-unused: New file. * testsuite/gas/elf/symver.d: Remove unused section symbols. * testsuite/gas/i386/ilp32/elf/symver.d: Likewise. * testsuite/gas/i386/ilp32/x86-64-size-1.d: Likewise. * testsuite/gas/i386/ilp32/x86-64-size-3.d: Likewise. * testsuite/gas/i386/ilp32/x86-64-size-5.d: Likewise. * testsuite/gas/i386/ilp32/x86-64-unwind.d: Likewise. * testsuite/gas/i386/size-1.d: Likewise. * testsuite/gas/i386/size-3.d: Likewise. * testsuite/gas/i386/svr4.d: Likewise. * testsuite/gas/i386/x86-64-size-1.d: Likewise. * testsuite/gas/i386/x86-64-size-3.d: Likewise. * testsuite/gas/i386/x86-64-size-5.d: Likewise. * testsuite/gas/i386/x86-64-unwind.d: Likewise. ld/ PR 27109 * testsuite/ld-elf/export-class.sd: Adjust the expected output. * testsuite/ld-elf/loadaddr3b.d: Likewise. * testsuite/ld-i386/ibt-plt-1.d: Likewise. * testsuite/ld-i386/ibt-plt-2a.d: Likewise. * testsuite/ld-i386/ibt-plt-2c.d: Likewise. * testsuite/ld-i386/ibt-plt-3a.d: Likewise. * testsuite/ld-i386/ibt-plt-3c.d: Likewise. * testsuite/ld-i386/pr19636-1d.d: Likewise. * testsuite/ld-i386/pr19636-1l.d: Likewise. * testsuite/ld-i386/pr19636-2c.d: Likewise. * testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise. * testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise. * testsuite/ld-ifunc/pr17154-i386-now.d: Likewise. * testsuite/ld-ifunc/pr17154-i386.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise. * testsuite/ld-ifunc/pr17154-x86-64.d: Likewise. * testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise. * testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise. * testsuite/ld-x86-64/bnd-plt-1.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-1.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-2c.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3a.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise. * testsuite/ld-x86-64/ibt-plt-3c.d: Likewise. * testsuite/ld-x86-64/pr19609-4e.d: Likewise. * testsuite/ld-x86-64/pr19609-6a.d: Likewise. * testsuite/ld-x86-64/pr19609-6b.d: Likewise. * testsuite/ld-x86-64/pr19609-7b.d: Likewise. * testsuite/ld-x86-64/pr19609-7d.d: Likewise. * testsuite/ld-x86-64/pr19636-2l.d: Likewise. * testsuite/ld-x86-64/pr20253-1d.d: Likewise. * testsuite/ld-x86-64/pr20253-1h.d: Likewise. * testsuite/ld-x86-64/pr21038b-now.d: Likewise. * testsuite/ld-x86-64/pr21038b.d: Likewise. * testsuite/ld-x86-64/pr21038c-now.d: Likewise. * testsuite/ld-x86-64/pr21038c.d: Likewise. * testsuite/ld-x86-64/pr23854.d: Likewise. * testsuite/ld-x86-64/pr25416-3.d: Likewise. * testsuite/ld-x86-64/pr25416-4.d: Likewise. * testsuite/ld-i386/plt-pic.pd: Likewise. * testsuite/ld-i386/plt-pic2.dd: Likewise. * testsuite/ld-i386/plt.pd: Likewise. * testsuite/ld-i386/plt2.dd: Likewise. * testsuite/ld-i386/tlsbin.rd: Likewise. * testsuite/ld-i386/tlsbin2.rd: Likewise. * testsuite/ld-i386/tlsbindesc.rd: Likewise. * testsuite/ld-i386/tlsdesc.rd: Likewise. * testsuite/ld-i386/tlsgdesc.rd: Likewise. * testsuite/ld-i386/tlsnopic.rd: Likewise. * testsuite/ld-i386/tlspic.rd: Likewise. * testsuite/ld-i386/tlspic2.rd: Likewise. * testsuite/ld-x86-64/mpx3.dd: Likewise. * testsuite/ld-x86-64/mpx3n.dd: Likewise. * testsuite/ld-x86-64/mpx4.dd: Likewise. * testsuite/ld-x86-64/mpx4n.dd: Likewise. * testsuite/ld-x86-64/pe-x86-64-1.od: Likewise. * testsuite/ld-x86-64/pe-x86-64-2.od: Likewise. * testsuite/ld-x86-64/pe-x86-64-3.od: Likewise. * testsuite/ld-x86-64/pe-x86-64-4.od: Likewise. * testsuite/ld-x86-64/plt.pd: Likewise. * testsuite/ld-x86-64/plt2.dd: Likewise. * testsuite/ld-x86-64/tlsbin.rd: Likewise. * testsuite/ld-x86-64/tlsbin2.rd: Likewise. * testsuite/ld-x86-64/tlsbindesc.rd: Likewise. * testsuite/ld-x86-64/tlsdesc.rd: Likewise. * testsuite/ld-x86-64/tlsgdesc.rd: Likewise. * testsuite/ld-x86-64/tlspic.rd: Likewise. * testsuite/ld-x86-64/tlspic2.rd: Likewise. * testsuite/ld-elf/sec64k.exp: Check is_elf_unused_section_symbols.
2021-01-07m68k: Require m68020up rather than m68000up for CHK.L instruction.Fredrik Noring2-1/+6
* m68k-opc.c (chkl): Change minimum architecture requirement to m68020.
2021-01-07Fix regression in Ada do_full_matchTom Tromey2-2/+12
An earlier patch to ada-lang.c:do_full_match introduced a subtle change to the semantics. The previous code did: - if (strncmp (sym_name, search_name, search_name_len) == 0 - && is_name_suffix (sym_name + search_name_len)) - return true; - - if (startswith (sym_name, "_ada_") whereas the new code unconditionally skips a leading "_ada_". The difference occurs if the lookup name itself starts with "_ada_". In this case, the symbol won't match. Normally this doesn't seem to be a problem. However, it caused a regression on one particular (internal) test case on one particular platform. This patch changes the code to handle this case. I don't know how to write a reliable test case for this, so no test is included. 2021-01-07 Tom Tromey <tromey@adacore.com> * ada-lang.c (do_full_match): Conditionally skip "_ada_" prefix.
2021-01-08sh-pe ld XPASSesAlan Modra4-4/+10
* testsuite/ld-scripts/fill.d: Skip sh-*-pe rather than xfail. * testsuite/ld-scripts/fill16.d: Don't xfail sh-*-pe. * testsuite/ld-scripts/segment-start.d: Likewise.
2021-01-08xfail more cases of complaints about relocs in read-only sectionsAlan Modra7-5/+21
* testsuite/ld-elf/comm-data5.d: xfail targets that complain about dynamic relocations in read-only sections. * testsuite/ld-elf/ehdr_start-shared.d: Likewise. * testsuite/ld-elf/ehdr_start.d: Likewise. * testsuite/ld-scripts/pr22267.d: Likewise. * testsuite/ld-elf/shared.exp: Likewise for DT_TEXTREL tests and pr20995 text. * testsuite/ld-elf/sec64k.exp: Don't run 64ksec on lm32-linux.
2021-01-07Fix regression in Ada aggregate assignmentTom Tromey4-1/+13
A recent upstream patch of mine caused a regression in aggregate assignment. The bug was that add_component_interval didn't properly update the array contents in one resize case. I found furthermore that there was no test case that would provoke this failure. This patch fixes the bug and introduces a test. gdb/ChangeLog 2021-01-07 Tom Tromey <tromey@adacore.com> * ada-lang.c (add_component_interval): Start loop using vector's updated size. gdb/testsuite/ChangeLog 2021-01-07 Tom Tromey <tromey@adacore.com> * gdb.ada/assign_arr.exp: Add 'others' test.
2021-01-07Fix another path length problem opening files on Win32 systems.Nick Clifton2-2/+27
PR 25713 * bfdio.c (_bfd_real_fopen): For Win32 convert relative paths to absolute paths and check to see if they are longer than MAX_PATH.
2021-01-07[gdb/build] Fix gdbserver build with -fsanitize=addressTom de Vries2-2/+18
When doing a gdbserver build with CFLAGS/CXXFLAGS/LDFLAGS=-fsanitize=address we run into: ... ld: ../libiberty/libiberty.a(safe-ctype.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC collect2: error: ld returned 1 exit status make[1]: *** [libinproctrace.so] Error 1 ... This started with commit 96648494173 "gdbsupport: make use of safe-ctype functions from libiberty", which introduced a dependency of libinproctrace.so on libiberty. Fix this in gdbserver/Makefile.in by using a setup similar to what is done in gcc-repo/src/libcc1/Makefile.am, such that ../libiberty/noasan/libiberty.a is used instead. Build on x86_64-linux, both with and without -fsanitize=address. gdbserver/ChangeLog: 2021-01-07 Tom de Vries <tdevries@suse.de> * Makefile.in (LIBIBERTY_NORMAL, LIBIBERTY_NOASAN, LIBIBERTY_PIC): (LIBIBERTY_FOR_SHLIB): New var. (LIBIBERTY): Set using $(LIBIBERTY_NORMAL). (IPA_LIB): Use LIBIBERTY_FOR_SHLIB instead of LIBIBERTY in target rule.
2021-01-07RISC-V: Add pause hint instruction.Philipp Tomsich11-1/+44
Add support for the pause hint instruction, as specified in the Zihintpause extension. The pause instruction is encoded as a special form of a memory fence (which is available as part of the base instruction set). The chosen encoding does not mandate any particular memory ordering and therefore is a true hint. bfd/ * elfxx-riscv.c (riscv_std_z_ext_strtab): Added zihintpause. gas/ * config/tc-riscv.c (riscv_multi_subset_supports): Added INSN_CLASS_ZIHINTPAUSE. * testsuite/gas/riscv/pause.d: New testcase. Adding coverage for the pause hint instruction. * testsuite/gas/riscv/pause.s: Likewise. include/ * opcode/riscv-opc.h: Added MATCH_PAUSE, MASK_PAUSE and DECLARE_INSN for pause hint instruction. * opcode/riscv.h (enum riscv_insn_class): Added INSN_CLASS_ZIHINTPAUSE. opcodes/ * riscv-opc.c (riscv_opcodes): Add pause hint instruction.
2021-01-07ld: xfail riscv64*-*-* for ld-scripts/empty-address-2 tests.Marcus Comstedt3-2/+7
For now we have supported the riscv big endian targets, so xfail riscv64*-*-* for ld-scripts/empty-address-2 tests, to cover both little endian and big endian targets. ld/ * testsuite/ld-scripts/empty-address-2a.d: xfail riscv64*-*-*. * testsuite/ld-scripts/empty-address-2b.d: Likewise.
2021-01-07fix paths in ChangeLogMike Frysinger1-5/+5