aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-22sim: drop configure scripts for simple portsMike Frysinger104-49374/+809
These ports only use the pieces that have been unified, so we can merge them into the common configure script and get rid of their unique one entirely. We still compile & link separate run programs, and have dedicated subdir Makefiles, but the configure script portion is merged.
2021-06-22gdb: fix python/lib/gdb/__init__.py formattingSimon Marchi2-3/+7
Run black to fix this formatting. gdb/ChangeLog: * python/lib/gdb/__init__.py: Format. Change-Id: I68ea306d1991bf7243b2c8aeeb11719d668851e5
2021-06-22gdb: remove unnecessary parameter wait_ptid from do_target_waitSimon Marchi2-7/+10
do_target_wait has a wait_ptid parameter, to filter what ptid we wait on. The sole caller of do_target_wait passes minus_one_ptid, meaning "all ptids". So in practice, this parameter is not needed, remove it. gdb/ChangeLog: * infrun.c (do_target_wait): Remove wait_ptid parameter. (fetch_inferior_event): Adjust. Change-Id: I54119beb43db678e4b2081dc490f89e7ff878e74
2021-06-22gdb/python: print name of unwinder that claimed frame in debug messageSimon Marchi3-11/+46
If we have multiple registered unwinders, this will helps identify which unwinder was chosen and make it easier to track down potential problems. Unwinders have a mandatory name argument, which we can use in the message. First, make gdb._execute_unwinders return a tuple containing the name, in addition to the UnwindInfo. Then, make pyuw_sniffer include the name in the debug message. I moved the debug message earlier. I think it's good to print it as early as possible, so that we see it in case an assert is hit in the loop below, for example. gdb/ChangeLog: * python/lib/gdb/__init__.py (_execute_unwinders): Return tuple with name of chosen unwinder. * python/py-unwind.c (pyuw_sniffer): Print name of chosen unwinder in debug message. Change-Id: Id603545b44a97df2a39dd1872fe1f38ad5059f03
2021-06-22gdb: Support DW_LLE_start_endAndreas Schwab6-1/+235
Without that it is impossible to debug on riscv64. gdb/ PR symtab/27999 * dwarf2/loc.c (decode_debug_loclists_addresses): Support DW_LLE_start_end. gdb/testsuite/ PR symtab/27999 * lib/dwarf.exp (start_end): New proc inside loclists. * gdb.dwarf2/loclists-start-end.exp: New file. * gdb.dwarf2/loclists-start-end.c: New file.
2021-06-22[gdb/testsuite] Add gdb.dwarf2/imported-unit-c.expTom de Vries2-0/+114
This test-case is intended to excercise this code in process_imported_unit_die: ... /* We're importing a C++ compilation unit with tag DW_TAG_compile_unit into another compilation unit, at root level. Regard this as a hint, and ignore it. */ if (die->parent && die->parent->parent == NULL && per_cu->unit_type == DW_UT_compile && per_cu->lang == language_cplus) return; ... in the sense that the test-case should fail if the "per_cu->lang == language_cplus" clause is removed. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-22 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/imported-unit-c.exp: New file.
2021-06-22RISC-V: Clarify the addends of pc-relative access.Nelson Chu11-68/+212
The original discussion was here, https://github.com/riscv/riscv-elf-psabi-doc/issues/184 After discussing with Kito Cheng, I think the addends of %pcrel_hi and %pcrel_lo are both allowed in GNU toolchain. However, both of the them mean the offset of symbols, rather than the pc address. But the addends of %got_pcrel_hi and it's %pcrel_lo do not look reasonable. I believe gcc won't generate the got patterns with addends, so linker should report dangerous relocation errors, in case the assembly code use them. Another issue was here, https://sourceware.org/pipermail/binutils/2021-June/116983.html At the beginnig, I suppose %pcrel_hi and %pcrel_lo are valid only when they are in the same input section. But Jim Wilson points out that gcc may generate %hi and %lo in the different input sections, when -freorder-blocks-and-partition option is used. So that a memory references for a loop may have the %hi outside the loop, but the %lo remain in the loop. However, it is hard to create the testcases, to see if %pcrel_hi and %pcrel_lo have the same behavior. Unfortunately, I notice that the current pcrel resolver cannot work for the above case. For now we build a hash table for pcrel at the start of riscv_elf_relocate_section, and then free the hash at the end. But riscv_elf_relocate_section only handles an input section at a time, so that means we can only resolve the %pcrel_hi and %pcrel_lo which are in the same input section. Otherwise, like the above case, we will report "%pcrel_lo missing matching %pcrel_hi" for them. I have no plan to improve this in the short-term, so maybe we can wait until someone meets the problem before we deal with it. bfd/ * elfnn-riscv.c (riscv_pcrel_hi_reloc): Added field to store the original relocation type, in case the type is converted to R_RISCV_HI20. (riscv_pcrel_lo_reloc): Removed unused name field. (riscv_pcrel_relocs): Added comments. (riscv_zero_pcrel_hi_reloc): Removed unused input_bfd. (riscv_record_pcrel_hi_reloc): Updated. (riscv_record_pcrel_lo_reloc): Likewise. (riscv_resolve_pcrel_lo_relocs): Likewise. Check the original type of auipc, to make sure the %pcrel_lo without any addends. Otherwise, report dangerous relocation error. (riscv_elf_relocate_section): Updated above functions are changed. For R_RISCV_GOT_HI20, report dangerous relocation error when addend isn't zero. ld/ * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated. * testsuite/ld-riscv-elf/pcrel-lo-addend-3a.d: New testcase. * testsuite/ld-riscv-elf/pcrel-lo-addend-3a.s: Likewise. * testsuite/ld-riscv-elf/pcrel-lo-addend-3b.d: New testcase. Should report error since the %pcrel_lo with addend refers to %got_pcrel_hi. * testsuite/ld-riscv-elf/pcrel-lo-addend-3b.s: Likewise. * testsuite/ld-riscv-elf/pcrel-lo-addend-3c.d: New testcase. Should report error since the %got_pcrel_hi with addend. * testsuite/ld-riscv-elf/pcrel-lo-addend-3c.s: Likewise. * testsuite/ld-riscv-elf/pcrel-lo-addend-3.ld: Likewise.
2021-06-22gdb/remote: handle target dying just before a stepiAndrew Burgess4-14/+73
I randomly hit a situation where gdbserver crashed immediately before I issued a 'stepi' to GDB, it turns out that this causes GDB itself to crash. What happens is that as part of the stepi we try to insert some breakpoints into the inferior, so from insert_breakpoints we figure out what we want to insert, then, eventually, try to send some packets to the remote to get the breakpoints inserted. It is only at this point that GDB realises that the target has gone away. This causes GDB to then enter this call stack: unpush_and_perror remote_unpush_target generic_mourn_inferior breakpoint_init_inferior delete_breakpoint update_global_location_list So, we realise the target is gone and so delete the breakpoints associated with that target. GDB then throws a TARGET_CLOSE_ERROR from unpush_and_error. This error is caught in insert_breakpoints where we then try to print a nice error saying something like: Cannot insert breakpoint %d: some error text here... To fill in the '%d' we try to read properties of the breakpoint object. Which was deleted due to the delete_breakpoint call above. And so GDB dies... My proposal in this commit is that, should we catch a TARGET_CLOSE_ERROR in insert_breakpoints, then we just rethrow the error. This will cause the main event loop to print something like: Remote connection closed Which I think is fine, I don't think the user will care much which particular breakpoint GDB was operating on when the connection closed, just knowing that the connection closed should be enough I think. I initially added a test to 'gdb.server/server-kill.exp' for this issue, however, my first attempt was not good enough, the test was passing even without my fix. Turns out that the server-kill.exp test actually kills the PID of the inferior, not the PID of the server. This means that gdbserver is actually able to send a packet to GDB saying that the inferior has exited prior to gdbserver itself shutting down. This extra information was enough to prevent the bug I was seeing manifest. So, I have extended server-kill.exp to run all of the tests twice, the first time we still kill the inferior. On the second run we hard kill the gdbserver itself, this prevents the server from sending anything to GDB before it exits. My new test is only expected to fail in this second mode of operation (killing gdbserver itself), and without my fix, that is what I see. gdb/ChangeLog: * breakpoint.c (insert_bp_location): If we catch a TARGET_CLOSE_ERROR just rethrow it, the breakpoints might have been deleted. gdb/testsuite/ChangeLog: * gdb.server/server-kill.exp: Introduce global kill_pid_of, and make use of this in prepare to select which pid we should kill. Run all the tests twice with a different kill_pid_of value. (prepare): Make use of kill_pid_of. (test_stepi): New proc.
2021-06-22opcodes: make use of __builtin_popcount when availableAndrew Burgess2-0/+9
This commit provides a small performance improvement when starting up CGEN based disassemblers by making use of __builtin_popcount. The #if check used in this commit was copied from bfd/elf32-arm.c where __builtin_popcount is also used. I ran into this code while investigating some GDB tests that would occasionally timeout. One of the reason these tests were having problems is that the m16c and m32c disassemblers take so long to initialise themselves. Speeding up count_decodable_bits helps, but is not a total solution. Still, this felt like an easy win which added minimal extra complexity, so I figure its worth doing. opcodes/ChangeLog: * cgen-dis.c (count_decodable_bits): Use __builtin_popcount when available.
2021-06-22picojava assembler and disassembler fixesAlan Modra6-175/+167
Commit 54758c3e398d made changes to the picojava support based on https://sourceware.org/pipermail/binutils/2005-November/045136.html An update from picojava to picojava II, I think. Unfortunately the patch neglected any changes to the gas testsuite, resulting in "FAIL: pj" since that date. This patch makes a few relatively simple changes to cure the regression. gas/ * config/tc-pj.c (md_apply_fix): Apply PJ_CODE_REL32 relocs. * testsuite/gas/pj/ops.s: Update jsr, ret, getstatic, putstatic, getfield, putfield, invokevirtual, invokespecial, invokestatic, invokeinterface, goto_w, jsr_w assembly. Delete version 1 picojava opcodes. * testsuite/gas/pj/ops.d: Match expected output. opcodes/ * pj-dis.c (print_insn_pj): Don't print trailing tab. Do print separator for pcrel insns.
2021-06-21sim: unify hardware settingsMike Frysinger103-1627/+230
Move these options up to the common dir so we only test & export them once across all ports.
2021-06-21sim: hw: rework configure option & device selectionMike Frysinger82-1324/+1052
The sim-hardware configure option allows builders to select a set of device models to enable. But this seems like unnecessary overkill: the existence of individual device models doesn't affect performance at all as they are only enabled at runtime if the config uses them, and individually these are all <5KB a piece. Stripping off a total of ~50KB from a ~1MB binary doesn't seem useful, and it's extremely unlikely anyone will ever bother. So let's simplify the configure/make logic by turning sim-hardware into a boolean option like many of the other sim options. Any ports that have unique device models will declare them in their Makefile instead of at configure time. This will allow us to (eventually) unify the setting into the common dir.
2021-06-22Automatic date update in version.inGDB Administrator1-1/+1
2021-06-21gdb/riscv: add support for vector registers in target descriptionsAndrew Burgess8-6/+177
This commit adds support to RISC-V GDB for vector registers in the incoming target description. The vector registers should be described in a feature called "org.gnu.gdb.riscv.vector", and should contain the register v0 to v31. There's no restriction on the size or type of these registers, so the target description can set these up as it requires. However, if the target feature is present then all of the registers must be present, and they must all be the same size, these requirements are, I believe, inline with the RISC-V vector extension. The DWARF register numbers for the vector registers have been added, and the code to map between GDB's internal numbering and the DWARF numbering has been updated. I have not yet added a feature/riscv/*.xml file for the vector extension, the consequence of this is that we can't, right now, detect vector registers on a native target, this patch is all about supporting vectors on a remote target. It is worth noting that I don't actually have access to a RISC-V target with vectors, so the only testing that this patch has had has been done using 'set tdesc filename ....' to load a target description to which I have manually added the vector feature. This has shown that the vector register feature can be successfully parsed, and that the registers show up in the expected register groups. Additionally, the RISC-V vector extension is currently at v0.10, which is also the v1.0 draft release. However, this extension is not yet finalised. It is possible (but unlikely I think) that the register set could change between now and the final release of the vector extension. If this were to happen then we would potentially end up changing the requirements for the new org.gnu.gdb.riscv.vector feature. I really don't think it is likely that the register set will change this late in the process, and even if it did, changing the feature requirements will not be a problem as far as I am concerned (when the alternative is GDB just continues without this feature for now). gdb/ChangeLog: * NEWS: Mention new target feature name. * arch/riscv.c (riscv_create_target_description): GDB doesn't currently create target descriptions containing vector registers. * arch/riscv.h (struct riscv_gdbarch_features) <vlen>: New member variable. <operator==>: Also compare vlen. <hash>: Also include vlen. * riscv-tdep.c (riscv_feature_name_vector): New static global. (struct riscv_vector_feature): New struct. (riscv_vector_feature): New static global. (riscv_register_reggroup_p): Ensure vector registers are part of the 'all' group, and part of the 'vector' group. (riscv_dwarf_reg_to_regnum): Handle vector registers. (riscv_gdbarch_init): Check vector register feature. * riscv-tdep.h: Add vector registers to GDB's internal register numbers, and to the DWARF register numbers. gdb/doc/ChangeLog: * gdb.texinfo (RISC-V Features): Mention vector register feature.
2021-06-21gdb/python: add PendingFrame.level and Frame.level methodsAndrew Burgess11-0/+258
Add new methods to the PendingFrame and Frame classes to obtain the stack frame level for each object. The use of 'level' as the method name is consistent with the existing attribute RecordFunctionSegment.level (though this is an attribute rather than a method). For Frame/PendingFrame I went with methods as these classes currently only use methods, including for simple data like architecture, so I want to be consistent with this interface. gdb/ChangeLog: * NEWS: Mention the two new methods. * python/py-frame.c (frapy_level): New function. (frame_object_methods): Register 'level' method. * python/py-unwind.c (pending_framepy_level): New function. (pending_frame_object_methods): Register 'level' method. gdb/doc/ChangeLog: * python.texi (Unwinding Frames in Python): Mention PendingFrame.level. (Frames In Python): Mention Frame.level. gdb/testsuite/ChangeLog: * gdb.python/py-frame.exp: Add Frame.level tests. * gdb.python/py-pending-frame-level.c: New file. * gdb.python/py-pending-frame-level.exp: New file. * gdb.python/py-pending-frame-level.py: New file.
2021-06-21gdb/python: move PyLong_From* calls into py-utils.cAndrew Burgess2-1/+6
We already have two helper functions in py-utils.c: gdb_py_object_from_longest (LONGEST l) gdb_py_object_from_ulongest (ULONGEST l) these wrap around calls to either PyLong_FromLongLong, PyLong_FromLong, or PyInt_From_Long (if Python 2 is being used). There is one place in gdb/python/* where a call to PyLong_FromLong was added outside of the above utility functions, this was done in the recent commit: commit 55789354fcbaf879f3ca8475b647b2747dec486e Date: Fri May 14 11:56:31 2021 +0200 gdb/python: add a 'connection_num' attribute to Inferior objects In this commit I replace the direct use of PyLong_FromLong with a call to gdb_py_object_from_longest. The only real change with this commit, is that, for Python 2, we will now end up calling PyInt_FromLong instead of PyLong_FromLong, but this should be invisible to the user. For Python 3 there should be absolutely no change. gdb/ChangeLog: * python/py-inferior.c (infpy_get_connection_num): Call gdb_py_object_from_longest instead of PyLong_FromLong directly.
2021-06-21gdb/python: handle saving user registers in a frame unwinderAndrew Burgess6-0/+239
This patch came about because I wanted to write a frame unwinder that would corrupt the backtrace in a particular way. In order to achieve what I wanted I ended up trying to write an unwinder like this: class FrameId(object): .... snip class definition .... class TestUnwinder(Unwinder): def __init__(self): Unwinder.__init__(self, "some name") def __call__(self, pending_frame): pc_desc = pending_frame.architecture().registers().find("pc") pc = pending_frame.read_register(pc_desc) sp_desc = pending_frame.architecture().registers().find("sp") sp = pending_frame.read_register(sp_desc) # ... snip code to decide if this unwinder applies or not. fid = FrameId(pc, sp) unwinder = pending_frame.create_unwind_info(fid) unwinder.add_saved_register(pc_desc, pc) unwinder.add_saved_register(sp_desc, sp) return unwinder The important things here are the two calls: unwinder.add_saved_register(pc_desc, pc) unwinder.add_saved_register(sp_desc, sp) On x86-64 these would fail with an assertion error: gdb/regcache.c:168: internal-error: int register_size(gdbarch*, int): Assertion `regnum >= 0 && regnum < gdbarch_num_cooked_regs (gdbarch)' failed. What happens is that in unwind_infopy_add_saved_register (py-unwind.c) we call register_size, as register_size should only be called on cooked (real or pseudo) registers, and 'pc' and 'sp' are implemented as user registers (at least on x86-64), we trigger the assertion. A simple fix would be to check in unwind_infopy_add_saved_register if the register number we are handling is a cooked register or not, if not we can throw a 'Bad register' error back to the Python code. However, I think we can do better. Consider that at the CLI we can do this: (gdb) set $pc=0x1234 This works because GDB first evaluates '$pc' to get a register value, then evaluates '0x1234' to create a value encapsulating the immediate. The contents of the immediate value are then copied back to the location of the register value representing '$pc'. The value location for a user-register will (usually) be the location of the real register that was accessed, so on x86-64 we'd expect this to be $rip. So, in this patch I propose that in the unwinder code, when add_saved_register is called, if it is passed a user-register (i.e. non-cooked) then we first fetch the register, extract the real register number from the value's location, and use that new register number when handling the add_saved_register call. If either the value location that we get for the user-register is not a cooked register then we can throw a 'Bad register' error back to the Python code, but in most cases this will not happen. gdb/ChangeLog: * python/py-unwind.c (unwind_infopy_add_saved_register): Handle saving user registers. gdb/testsuite/ChangeLog: * gdb.python/py-unwind-user-regs.c: New file. * gdb.python/py-unwind-user-regs.exp: New file. * gdb.python/py-unwind-user-regs.py: New file.
2021-06-20sim: cris: clean up printf & abort usage a bitMike Frysinger2-40/+43
Inline the stats printf calls to avoid compiler warnings about non-literal format strings. This in turn highlights bad type sizes being passed in, so fix the strings to use the right size type. This in turn highlights the rest of the func using casts rather than the right type directly, so adjust all of those. Finally, replace a few abort+sim_engine_halt calls with the common sim_engine_abort. This provides good output while still aborting as we want.
2021-06-21Automatic date update in version.inGDB Administrator1-1/+1
2021-06-20sim: rx: scope the unique configure flagMike Frysinger4-22/+34
This will make it possible to merge into the common configure by making sure we never collide with other arches.
2021-06-20sim: delete SIM_AC_COMMON macroMike Frysinger127-188/+160
Now that we've moved all content out to the common file, this is empty and can be deleted it entirely.
2021-06-20sim: unify general maintainer settingsMike Frysinger77-3849/+64
Move these options up to the common dir so we only test & export them once across all ports. This takes a page from the cgen maint logic to make $(MAINT) work for non-automake Makefiles which will allow us to merge it together.
2021-06-20sim: unify cgen maintainer settingsMike Frysinger43-318/+104
Move these options up to the common dir so we only test & export them once across all ports. It makes it available to targets that aren't cgen-based, but those will just ignore the settings, so it shouldn't be an issue.
2021-06-20sim: m68hc11: fix unused function warnings with -O0Mike Frysinger2-22/+26
Mark these functions as unused in case they don't get inlined when building with -O0.
2021-06-20sim: move sim-inline to the common codeMike Frysinger108-1207/+230
This will allow us to build the common code with the same inline settings as the arch subdirs, and only do the test once.
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.