aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-07-10Automatic date update in version.inGDB Administrator1-1/+1
2020-07-09Don't compare the pid returned from 'wait' against inferior_ptid.John Baldwin2-1/+6
'inf_ptrace::wait' needs to discard termination events reported by detached child processes. Previously it compared the returned pid against the pid in inferior_ptid to determine if a termination event should be discarded or reported. The multi-target changes cleared inferior_ptid to null_ptid in 'wait' target methods, so this was always failing and never reporting exit events. Instead, report termination events whose pid matches any inferior belonging to the current target. Several tests started failing on FreeBSD after the multi-target changes and pass again after this change. gdb/ChangeLog: * inf-ptrace.c (inf_ptrace_target::wait): Don't compare against inferior_ptid.
2020-07-09x86: Properly set YMM/ZMM featuresH.J. Lu9-2/+64
Since VEX/EVEX vector instructions will always update the full YMM/ZMM registers, set YMM/ZMM features for VEX/EVEX vector instructions. * config/tc-i386.c (output_insn): Set YMM/ZMM features for VEX/EVEX vector instructions. * testsuite/gas/i386/property-4.d: New file. * testsuite/gas/i386/property-4.s: Likewise. * testsuite/gas/i386/property-5.d: Likewise. * testsuite/gas/i386/property-5.s: Likewise. * testsuite/gas/i386/x86-64-property-4.d: Likewise. * testsuite/gas/i386/x86-64-property-5.d: Likewise.
2020-07-09Support several new ELF auxiliary vector types on FreeBSD.John Baldwin4-0/+21
FreeBSD's kernel recently added several ELF auxiliary vector entries to describe the arguments passed to new executable images during exec(). The AT_FREEBSD_ARGC and AT_FREEBSD_ARGV entries give the length and address of the process argument array. AT_FREEBSD_ENVC and AT_FREEBSD_ENVV entries give the length and address of the initial process environment. AT_FREEBSD_PS_STRINGS gives the address of the 'struct ps_strings' object. include/ChangeLog: * elf/common.h (AT_FREEBSD_ARGC, AT_FREEBSD_ARGV, AT_FREEBSD_ENVC) (AT_FREEBSD_ENVV, AT_FREEBSD_PS_STRINGS): Define. gdb/ChangeLog: * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_FREEBSD_ARGC, AT_FREEBSD_ARGV, AT_FREEBSD_ENVC, AT_FREEBSD_ENVV, AT_FREEBSD_PS_STRINGS.
2020-07-09Linux/x86: Configure gas with --enable-x86-used-note by defaultH.J. Lu4-0/+23
* configure.ac: Configure with --enable-x86-used-note by default for Linux/x86. * configure: Regenerated.
2020-07-09Remove powerpc PE supportAlan Modra38-4421/+96
Plus some leftover powerpc lynxos support. bfd/ * coff-ppc.c: Delete. * pe-ppc.c: Delete. * pei-ppc.c: Delete. * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Remove PE PPC. * coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Remove PPCMAGIC code. (coff_write_object_contents): Remove PPC_PE code. * config.bfd: Move powerpcle-pe to removed targets. * configure.ac: Remove powerpc PE entries. * libcoff-in.h (ppc_allocate_toc_section): Delete. (ppc_process_before_allocation): Delete. * peXXigen.c: Remove POWERPC_LE_PE code and comments. * targets.c: Remove powerpc PE vectors. * po/SRC-POTFILES.in: Regenerate. * libcoff.h: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. binutils/ * dlltool.c: Remove powerpc PE support and comments. * configure.ac: Remove powerpc PE dlltool config. * configure: Regenerate. gas/ * config/obj-coff.h: Remove TE_PE support. * config/tc-ppc.c: Likewise. * config/tc-ppc.h: Likewise. * configure.tgt: Remove powerpc PE and powerpc lynxos. * testsuite/gas/cfi/cfi.exp (cfi-common-6): Remove powerpc PE condition. * testsuite/gas/macros/macros.exp: Don't xfail powerpc PE. include/ * coff/powerpc.h: Delete. ld/ * emulparams/ppcpe.sh: Delete. * scripttempl/ppcpe.sc: Delete. * emulparams/ppclynx.sh: Delete. * Makefile.am (ALL_EMULATION_SOURCES): Remove ppc PE and lynxos. * configure.tgt: Likewise. * emultempl/beos.em: Remove powerpc PE support. * emultempl/pe.em: Likewise. * po/BLD-POTFILES.in: Regenerate. * Makefile.in: Regenerate.
2020-07-09powerpc garbage collect testAlan Modra2-6/+8
ld's garbage collection test on powerpc64 catered for old compilers (pre -mcmodel=medium support), setting options that caused the test to fail. Which meant the test wasn't really testing anything. Get rid of that old compiler support, and avoid -fPIE fails on ppc32. * testsuite/ld-gc/gc.exp: Don't set -mminimal-toc for powerpc64, and remove powerpc64 xfail. Use -fno-PIE for ppc32.
2020-07-09pr18841 tests on powerpc64Alan Modra2-9/+14
The PR18841 test does cross-module calls from within an ifunc resolver, which is nasty, and not supported in general since the called function may not be relocated. In this case the called function (zoo) is just a stub so doesn't need relocating, but on ppc64 the function descriptor for zoo in the executable won't be relocated at the time the shared library ifunc resolver runs. That means the test will fail if your compiler generates PIEs by default. PR 18841 * testsuite/ld-ifunc/ifunc.exp: Run pr18841 tests non-pie.
2020-07-09Update Turkish translation in the gprof sub-directoryNick Clifton2-5/+9
2020-07-09Update French translation in the bfd sub-directoryNick Clifton2-1676/+1895
2020-07-09Update the Windows Resource compiler (windres) to support the OWNERDRAW and ↵Nick Clifton6-2/+42
BITMAP menuitem flags. binutils* rclex.c: Add OWNERDRAW keyword. * rcparse.y: Add OWNERDRAW token. (menuitem_flag) Add BITMAP and OWNERDRAW entries. * resrc.c (write_rc_menuitems): Add support for OWNERDRAW and BITMAP flags. * windres.c (extended_menuitems): Likewise. * testsuite/binutils-all/windres/menuitem_flags.rc: New test.
2020-07-09asan: readelf: heap buffer overflow in slurp_hppa_unwind_tableAlan Modra2-2/+6
This one isn't just a weird corner case requiring multiple .PARISC.unwind sections in an object file to trigger the buffer overflow, it's also a simple bug that would prevent relocations being applied in the normal case of a single .PARISC.unwind section. * readelf (slurp_hppa_unwind_table): Set table_len before use in relocation sanity checks.
2020-07-09Automatic date update in version.inGDB Administrator1-1/+1
2020-07-08Handle Windows drives in auto-load script pathsHannes Domani4-0/+21
Fixes this testsuite fail on Windows: FAIL: gdb.base/auto-load.exp: print $script_loaded Converts the debugfile path from c:/dir/file to /c/dir/file, so it can be appended to the auto-load path. gdb/ChangeLog: 2020-07-08 Hannes Domani <ssbssa@yahoo.de> * auto-load.c (auto_load_objfile_script_1): Convert drive part of debugfile path on Windows. gdb/doc/ChangeLog: 2020-07-08 Hannes Domani <ssbssa@yahoo.de> * gdb.texinfo: Document Windows drive conversion of 'set auto-load scripts-directory'.
2020-07-08Rename the 'obfd' argument to fbsd_nat_target::find_memory_regions.John Baldwin2-6/+11
The argument is passed as a generic cookie value to the supplied callback and is not necessarily a pointer to a bfd. gdb/ChangeLog: * fbsd-nat.c (fbsd_nat_target::find_memory_regions): Rename 'obfd' argument to 'data'.
2020-07-08Use read_memory in ada_exception_message_1Tom Tromey5-3/+17
Testing using the internal AdaCore test suite showed a regression from the target string reading changes. In particular, now ada_exception_message_1 can get the wrong answer in some cases. In particular, when an Ada exception catchpoint is hit, sometimes the exception name will be incorrect. The case I was seeing changed from the correct: Catchpoint 2, CONSTRAINT_ERROR (catch C_E) at [...] to: Catchpoint 2, CONSTRAINT_ERROR (catch C_EE) at [...] I was not able to reproduce this failure with the Fedora gnat. Perhaps it is related to some local change to gnat; I do not know. Meanwhile, because ada_exception_message_1 knows the length of the string to read, we can use read_memory here. This fixes the bug. I've updated the test suite to at least exercise this code path. However, as mentioned above, the new test does not actually provoke the failure. gdb/ChangeLog 2020-07-08 Tom Tromey <tromey@adacore.com> * ada-lang.c (ada_exception_message_1): Use read_memory. gdb/testsuite/ChangeLog 2020-07-08 Tom Tromey <tromey@adacore.com> * gdb.ada/catch_ex/foo.adb: Pass string to raise. * gdb.ada/catch_ex.exp: Examine catchpoint text.
2020-07-08Commit: Fix GOLD testsuite failures for 2.35 branch.Nick Clifton3-2/+11
* testsuite/script_test_7.sh: Adjust expected address of the .bss section. * testsuite/script_test_9.sh: Do not expect the .init section to immediately follow the .text section in the mapping of sections to segments.
2020-07-08x86: various XOP insns lack L and/or W bit decodingJan Beulich2-123/+630
While some insns support both XOP.W based operand swapping and 256-bit operation (XOP.L=1), many others don't support one or both. For {L,S}LWPCB also fix the so far not decoded ModRM.mod == 3 restriction. Take the opportunity and replace the custom OP_LWP_E() and OP_LWPCB_E() routines by suitable other, non-custom operanbd specifiers.
2020-07-08x86: FMA4 scalar insns ignore VEX.LJan Beulich8-101/+168
Just like other VEX-encoded scalar insns do. Besides a testcase for this behavior also introduce one to verify that XOP scalar insns don't honor -mavxscalar=256, as they don't ignore XOP.L.
2020-07-08x86: re-work operand swapping for XOP shift/rotate insnsJan Beulich2-74/+32
There's no need for custom operand handling here, except for the VEX.W controlled operand swapping.
2020-07-08x86: re-work operand handling for 5-operand XOP insnsJan Beulich2-194/+19
There's no need for custom operand handling here, except for the VEX.W controlled operand swapping and the printing of the remaining 4-bit immediate. VEX.W can be handled just like 4-operand insns. Also take the opportunity and drop the stray indirection through vex_w_table[].
2020-07-08x86: re-work operand swapping for FMA4 and 4-operand XOP insnsJan Beulich2-65/+49
There's no need for custom operand handling here, except for the VEX.W controlled operand swapping. The latter can be easily integrated into OP_REG_VexI4().
2020-07-08powerpc-aix5.2 testsAlan Modra87-595/+989
git commit bbd0c8e20472 broke many of these tests, and there have been other changes that caused failures too. * testsuite/lib/ld-lib.exp (ar_simple_create): Pass options before ar command. * testsuite/ld-powerpc/aix52.exp: Run for rs6000-aix5.2. Update match files. * testsuite/ld-powerpc/aix-abs-branch-1.dd: Update. * testsuite/ld-powerpc/aix-core-sec-1.hd: Update. * testsuite/ld-powerpc/aix-gc-1-32.dd: Update. * testsuite/ld-powerpc/aix-gc-1-64.dd: Update. * testsuite/ld-powerpc/aix-glink-1-32.dd: Update. * testsuite/ld-powerpc/aix-glink-1-64.dd: Update. * testsuite/ld-powerpc/aix-glink-2-32.dd: Update. * testsuite/ld-powerpc/aix-glink-2-64.dd: Update. * testsuite/ld-powerpc/aix-no-dup-syms-1-rel.rd: Update. * testsuite/ld-powerpc/aix-ref-1-32.od: Update. * testsuite/ld-powerpc/aix-ref-1-64.od: Update. * testsuite/ld-powerpc/aix-toc-1-32.dd: Update. * testsuite/ld-powerpc/aix-toc-1-64.dd: Update. * testsuite/ld-powerpc/aix-weak-3-32.dd: Update. * testsuite/ld-powerpc/aix-weak-3-64.dd: Update. * testsuite/ld-powerpc/aix-abs-branch-1.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-abs-branch-1-32.nd, * testsuite/ld-powerpc/aix-abs-branch-1-64.nd: ..these new files. * testsuite/ld-powerpc/aix-abs-reloc-1.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-abs-reloc-1-32.nd, * testsuite/ld-powerpc/aix-abs-reloc-1-64.nd: ..these new files. * testsuite/ld-powerpc/aix-abs-reloc-1.od: Delete, replace with.. * testsuite/ld-powerpc/aix-abs-reloc-1-32.od, * testsuite/ld-powerpc/aix-abs-reloc-1-64.od: ..these new files. * testsuite/ld-powerpc/aix-export-1-all.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-export-1-all-32.dd, * testsuite/ld-powerpc/aix-export-1-all-64.dd: ..these new files. * testsuite/ld-powerpc/aix-export-1-full.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-export-1-full-32.dd, * testsuite/ld-powerpc/aix-export-1-full-64.dd: ..these new files. * testsuite/ld-powerpc/aix-export-2.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-export-2-32.nd, * testsuite/ld-powerpc/aix-export-2-64.nd: ..these new files. * testsuite/ld-powerpc/aix-gc-1.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-gc-1-32.nd, * testsuite/ld-powerpc/aix-gc-1-64.nd: ..these new files. * testsuite/ld-powerpc/aix-glink-3.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-glink-3-32.dd, * testsuite/ld-powerpc/aix-glink-3-64.dd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1a.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1a-32.dd, * testsuite/ld-powerpc/aix-lineno-1a-64.dd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1a.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1a-32.nd, * testsuite/ld-powerpc/aix-lineno-1a-64.nd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1b.dd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1b-32.dd, * testsuite/ld-powerpc/aix-lineno-1b-64.dd: ..these new files. * testsuite/ld-powerpc/aix-lineno-1b.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-lineno-1b-32.nd, * testsuite/ld-powerpc/aix-lineno-1b-64.nd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.dnd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.dnd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.dnd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.drd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.drd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.drd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.nd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.nd: ..these new files. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso.rd: Delete, replace with.. * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-32.rd, * testsuite/ld-powerpc/aix-no-dup-syms-1-dso-64.rd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-dso.dnd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-dso-32.dnd, * testsuite/ld-powerpc/aix-weak-1-dso-64.dnd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-dso.hd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-dso-32.hd, * testsuite/ld-powerpc/aix-weak-1-dso-64.hd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-dso.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-dso-32.nd, * testsuite/ld-powerpc/aix-weak-1-dso-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-gcdso.dnd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-gcdso-32.dnd, * testsuite/ld-powerpc/aix-weak-1-gcdso-64.dnd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-gcdso.hd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-gcdso-32.hd, * testsuite/ld-powerpc/aix-weak-1-gcdso-64.hd: ..these new files. * testsuite/ld-powerpc/aix-weak-1-gcdso.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-1-gcdso-32.nd, * testsuite/ld-powerpc/aix-weak-1-gcdso-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2a.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2a-32.nd, * testsuite/ld-powerpc/aix-weak-2a-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2b.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2b-32.nd, * testsuite/ld-powerpc/aix-weak-2b-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2c.nd: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2c-32.nd, * testsuite/ld-powerpc/aix-weak-2c-64.nd: ..these new files. * testsuite/ld-powerpc/aix-weak-2c.od: Delete, replace with.. * testsuite/ld-powerpc/aix-weak-2c-32.od, * testsuite/ld-powerpc/aix-weak-2c-64.od: ..these new files.
2020-07-08Automatic date update in version.inGDB Administrator1-1/+1
2020-07-07arc: Improve error messages when assemblingClaudiu Zissulescu7-30/+63
gas/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (find_opcode_match): Add error messages. * testsuite/gas/arc/add_s-err.s: Update test. * testsuite/gas/arc/asm-errors.err: Likewise. * testsuite/gas/arc/cpu-em-err.s: Likewise. * testsuite/gas/arc/hregs-err.s: Likewise. * testsuite/gas/arc/warn.s: Likewise.
2020-07-07arc: Update vector instructions.Claudiu Zissulescu4-79/+105
Update vadd2, vadd4h, vmac2h, vmpy2h, vsub4h vector instructions arguments to discriminate between double/single register operands. opcodes/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * arc-opc.c (insert_rbd): New function. (RBD): Define. (RBDdup): Likewise. * arc-tbl.h (vadd2, vadd4h, vmac2h, vmpy2h, vsub4h): Update instructions. Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2020-07-07Re: Use is_xcoff_format in ld testsuiteAlan Modra2-1/+6
git commit 7193487fa8 took h8300 out of the notarget list, resulting in h8300-elf +FAIL: ld-scripts/section-match-1 h8300-linux +FAIL: ld-scripts/section-match-1 * testsuite/ld-scripts/section-match-1.d: xfail h8300.
2020-07-07x86: Remove an incorrect AVX2 entryH.J. Lu2-10/+5
The upper 16 vector registers were added by AVX512. PR gas/26212 * doc/c-i386.texi: Remove an incorrect AVX2 entry.
2020-07-07XCOFF ld testsuite fixesAlan Modra53-59/+162
* testsuite/ld-scripts/align.exp: Don't exclude xcoff. Pass -bnogc ld option for xcoff. * testsuite/ld-scripts/provide.exp: Likewise. * testsuite/ld-scripts/data.exp: Pass -bnogc ld option for xcoff. * testsuite/ld-scripts/default-script.exp: Likewise. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/empty-address.exp: Likewise. * testsuite/ld-scripts/expr.exp: Likewise. * testsuite/ld-scripts/include.exp: Likewise. * testsuite/ld-scripts/script.exp: Likewise. * testsuite/ld-scripts/assign-loc.d: Don't exclude xcoff. * testsuite/ld-scripts/defined3.d: Likewise. * testsuite/ld-scripts/defined4.d: Likewise. * testsuite/ld-scripts/pr18963.d: Likewise. * testsuite/ld-scripts/sane1.d: Likewise. * testsuite/ld-scripts/segment-start.d: Likewise. * testsuite/ld-scripts/include-1.d: Likewise, and relax text vma. * testsuite/ld-scripts/defined5.d: Update xfail and comment. * testsuite/ld-scripts/defined5.s: Tweak "defined" to be at non-zero section offset. * testsuite/ld-scripts/fill16.d: xfail for xcoff. * testsuite/ld-scripts/provide-2.d: Accept more symbols. * testsuite/ld-scripts/provide-4.d: Likewise. * testsuite/ld-scripts/provide-5.d: Likewise. * testsuite/ld-scripts/provide-6.d: Likewise. * testsuite/ld-scripts/provide-7.d: Likewise. * testsuite/ld-scripts/align.t: Accept xcoff mapped .text and .data. * testsuite/ld-scripts/defined3.t: Likewise. * testsuite/ld-scripts/defined4.t: Likewise. * testsuite/ld-scripts/defined5.t: Likewise. * testsuite/ld-scripts/fill.t: Likewise. * testsuite/ld-scripts/include-subdata.t: Likewise. * testsuite/ld-scripts/provide-1.t: Likewise. * testsuite/ld-scripts/provide-2.t: Likewise. * testsuite/ld-scripts/provide-3.t: Likewise. * testsuite/ld-scripts/provide-4.t: Likewise. * testsuite/ld-scripts/provide-5.t: Likewise. * testsuite/ld-scripts/provide-6.t: Likewise. * testsuite/ld-scripts/provide-7.t: Likewise. * testsuite/ld-scripts/provide-8.t: Likewise. * testsuite/ld-scripts/assign-loc.t: Add required xcoff sections. * testsuite/ld-scripts/sizeof.t: Likewise. * testsuite/ld-scripts/align2.t: Likewise, and mapped sections. * testsuite/ld-scripts/align5.t: Likewise. * testsuite/ld-scripts/default-script.t: Likewise. * testsuite/ld-scripts/empty-address-1.t: Likewise. * testsuite/ld-scripts/empty-address-2a.t: Likewise. * testsuite/ld-scripts/empty-address-2b.t: Likewise. * testsuite/ld-scripts/empty-address-3a.t: Likewise. * testsuite/ld-scripts/empty-address-3b.t: Likewise. * testsuite/ld-scripts/empty-address-3c.t: Likewise. * testsuite/ld-scripts/include-sections.t: Likewise. * testsuite/ld-scripts/pr14962.t: Likewise. * testsuite/ld-scripts/sane1.t: Likewise.
2020-07-07Use is_pecoff_format in ld testsuiteAlan Modra9-25/+46
--image-base 0 is not just for x86_64 mingw. This patch fixes that, and a case where a changed LDFLAGS leaked out of one script to the next. * testsuite/ld-scripts/align.exp: Use is_pecoff_format. * testsuite/ld-scripts/defined.exp: Likewise. * testsuite/ld-scripts/provide.exp: Likewise. * testsuite/ld-scripts/weak.exp: Likewise. * testsuite/ld-scripts/empty-address.exp: Likewise. Reset LDFLAGS on exit. * testsuite/ld-scripts/expr.exp: Set LDFLAGS earlier, and with --image-base for PE. * testsuite/ld-scripts/include.exp: Set LDFLAGS for PE. * testsuite/ld-scripts/script.exp: Use is_pecoff_format, and set LDFLAGS as well as flags.
2020-07-07Use is_xcoff_format in ld testsuiteAlan Modra11-116/+63
* testsuite/ld-checks/checks.exp: Use is_xcoff_format. * testsuite/ld-powerpc/powerpc.exp: Likewise. * testsuite/ld-scripts/print-memory-usage.exp: Likewise. * testsuite/ld-srec/srec.exp: Likewise. * testsuite/ld-undefined/require-defined.exp: Likewise. * testsuite/ld-scripts/expr2.d: Likewise. * testsuite/ld-scripts/section-match-1.d: Only run for ELF. * testsuite/ld-elfvers/vers.exp: Delete dead code. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise.
2020-07-07Use is_xcoff_format in gas testsuiteAlan Modra4-5/+11
* testsuite/gas/all/gas.exp: Use is_xcoff_format. * testsuite/gas/ppc/ppc.exp: Likewise. * testsuite/gas/all/weakref1l.d: Likewise.
2020-07-07Use is_xcoff_format in binutils testsuiteAlan Modra7-12/+26
and restrict some other tests using is_*_format. * testsuite/binutils-all/ar.exp: Use is_xcoff_format. * testsuite/binutils-all/nm.exp: Likewise. * testsuite/binutils-all/copy-2.d: Run only for elf and pe targets. * testsuite/binutils-all/copy-3.d: Run only for elf targets. * testsuite/binutils-all/set-section-alignment.d: Likewise. * testsuite/binutils-all/copy-4.d: Don't run for xcoff.
2020-07-07XCOFF binutils testsuite fixAlan Modra3-1/+19
Avoid an UNRESOLVED test due to "Error: the XCOFF file format does not support arbitrary sections". * testsuite/lib/binutils-common.exp (is_xcoff_format): New. * testsuite/binutils-all/objcopy.exp (pr25662): Exclude xcoff.
2020-07-07XCOFF linker script PROVIDE supportAlan Modra2-0/+6
Fixes bit rot from git commit b46a87b1606. * emultempl/aix.em (gld${EMULATION_NAME}_find_exp_assignment): Handle etree_provided.
2020-07-07XCOFF ld segfaults when running ld testsuiteAlan Modra2-7/+30
The binutils XCOFF support doesn't handle random linker scripts very well at all. These tweaks to final_link fix segfaults when some linker created sections are discarded due to "/DISCARD/ : { *(.*) }" in scripts. The xcoff_mark change is necessary to not segfault on symbols defined in scripts, which may be bfd_link_hash_defined yet have u.def.section set to bfd_und_section_ptr. (Which might seem odd, but occurs during early stages of linking before input sections are mapped.) * xcofflink.c (xcoff_mark): Don't mark const sections. (bfd_xcoff_record_link_assignment): Add FIXME. (_bfd_xcoff_bfd_final_link): Don't segfault on assorted magic sections being discarded by linker script.
2020-07-07XCOFF deterministic archivesAlan Modra2-0/+20
Adds support for "ar -D". * coff-rs6000.c (xcoff_write_archive_contents_old): Set default time, uid, gid and mode for deterministic archive. (xcoff_write_archive_contents_big): Likewise.
2020-07-07XCOFF C_HIDEXT and C_AIX_WEAKEXT classificationAlan Modra2-0/+15
If C_HIDEXT and C_AIX_WEAKEXT symbols aren't handled as globals by coff_classify_symbol then we run into "warning: .. local symbol `some garbage name' has no section". These are of course both global symbols, but C_HIDEXT is like a local in some respects and returning COFF_SYMBOL_LOCAL for C_HIDEXT keeps nm output looking the same. Fixes these fails on rs6000-aix5.1: -FAIL: weakref tests, relocations -FAIL: weakref tests, global syms -FAIL: weakref tests, strong undefined syms -FAIL: weakref tests, weak undefined syms * coffcode.h (coff_classify_symbol): Handle C_HIDEXT and C_AIX_WEAKEXT.
2020-07-07sh vxworks testsAlan Modra3-2/+7
These tests were failing only due to not being updated for readelf output changes. * testsuite/ld-sh/vxworks1-lib.rd: Update expected output. * testsuite/ld-sh/vxworks4.d: Likewise.
2020-07-07Stop the GOLD linker from complaining about relocations from ↵Nick Clifton2-0/+6
.gnu.build.attributes sections to discarded code sections. * target-reloc.h (Default_comdat_behaviour:get): Ignore discarded relocs that refer to the .gnu.build.attributes section.
2020-07-07Fix recent failures in the ARM assembler testsuite due to the correction of ↵Nick Clifton2-92/+97
a spelling mistake. * testsuite/gas/arm/cde-missing-fp.l: Fix spelling mistake in expected output.
2020-07-07x86: introduce %BW to avoid going through vex_w_table[]Jan Beulich4-77/+27
This parallels %LW and %XW.
2020-07-07Automatic date update in version.inGDB Administrator1-1/+1
2020-07-06gdb: Python unwinders, inline frames, and tail-call framesAndrew Burgess9-48/+185
This started with me running into the bug described in python/22748, in summary, if the frame sniffing code accessed any registers within an inline frame then GDB would crash with this error: gdb/frame.c:579: internal-error: frame_id get_frame_id(frame_info*): Assertion `fi->level == 0' failed. The problem is that, when in the Python unwinder I write this: pending_frame.read_register ("register-name") This is translated internally into a call to `value_of_register', which in turn becomes a call to `value_of_register_lazy'. Usually this isn't a problem, `value_of_register_lazy' requires the next frame (more inner) to have a valid frame_id, which will be the case (if we're sniffing frame #1, then frame #0 will have had its frame-id figured out). Unfortunately if frame #0 is inline within frame #1, then the frame-id for frame #0 can't be computed until we have the frame-id for #1. As a result we can't create a lazy register for frame #1 when frame #0 is inline. Initially I proposed a solution inline with that proposed in bugzilla, changing value_of_register to avoid creating a lazy register value. However, when this was discussed on the mailing list I got this reply: https://sourceware.org/pipermail/gdb-patches/2020-June/169633.html Which led me to look at these two patches: [1] https://sourceware.org/pipermail/gdb-patches/2020-April/167612.html [2] https://sourceware.org/pipermail/gdb-patches/2020-April/167930.html When I considered patches [1] and [2] I saw that all of the issues being addressed here were related, and that there was a single solution that could address all of these issues. First I wrote the new test gdb.opt/inline-frame-tailcall.exp, which shows that [1] and [2] regress the inline tail-call unwinder, the reason for this is that these two patches replace a call to gdbarch_unwind_pc with a call to get_frame_register, however, this is not correct. The previous call to gdbarch_unwind_pc takes THIS_FRAME and returns the $pc value in the previous frame. In contrast get_frame_register takes THIS_FRAME and returns the value of the $pc in THIS_FRAME; these calls are not equivalent. The reason these patches appear (or do) fix the regressions listed in [1] is that the tail call sniffer depends on identifying the address of a caller and a callee, GDB then looks for a tail-call sequence that takes us from the caller address to the callee, if such a series is found then tail-call frames are added. The bug that was being hit, and which was address in patch [1] is that in order to find the address of the caller, GDB ended up creating a lazy register value for an inline frame with to frame-id. The solution in patch [1] is to instead take the address of the callee and treat this as the address of the caller. Getting the address of the callee works, but we then end up looking for a tail-call series from the callee to the callee, which obviously doesn't return any sane results, so we don't insert any tail call frames. The original patch [1] did cause some breakage, so patch [2] undid patch [1] in all cases except those where we had an inline frame with no frame-id. It just so happens that there were no tests that fitted this description _and_ which required tail-call frames to be successfully spotted, as a result patch [2] appeared to work. The new test inline-frame-tailcall.exp, exposes the flaw in patch [2]. This commit undoes patch [1] and [2], and replaces them with a new solution, which is also different to the solution proposed in the python/22748 bug report. In this solution I propose that we introduce some special case logic to value_of_register_lazy. To understand what this logic is we must first look at how inline frames unwind registers, this is very simple, they do this: static struct value * inline_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum) { return get_frame_register_value (this_frame, regnum); } And remember: struct value * get_frame_register_value (struct frame_info *frame, int regnum) { return frame_unwind_register_value (frame->next, regnum); } So in all cases, unwinding a register in an inline frame just asks the next frame to unwind the register, this makes sense, as an inline frame doesn't really exist, when we unwind a register in an inline frame, we're really just asking the next frame for the value of the register in the previous, non-inline frame. So, if we assume that we only get into the missing frame-id situation when we try to unwind a register from an inline frame during the frame sniffing process, then we can change value_of_register_lazy to not create lazy register values for an inline frame. Imagine this stack setup, where #1 is inline within #2. #3 -> #2 -> #1 -> #0 \______/ inline Now when trying to figure out the frame-id for #1, we need to compute the frame-id for #2. If the frame sniffer for #2 causes a lazy register read in #2, either due to a Python Unwinder, or for the tail-call sniffer, then we call value_of_register_lazy passing in frame #2. In value_of_register_lazy, we grab the next frame, which is #1, and we used to then ask for the frame-id of #1, which was not computed, and this was our bug. Now, I propose we spot that #1 is an inline frame, and so lookup the next frame of #1, which is #0. As #0 is not inline it will have a valid frame-id, and so we create a lazy register value using #0 as the next-frame-id. This will give us the exact same result we had previously (thanks to the code we inspected above). Encoding into value_of_register_lazy the knowledge that reading an inline frame register will always just forward to the next frame feels.... not ideal, but this seems like the cleanest solution to this recursive frame-id computation/sniffing issue that appears to crop up. The following two commits are fully reverted with this commit, these correspond to patches [1] and [2] respectively: commit 5939967b355ba6a940887d19847b7893a4506067 Date: Tue Apr 14 17:26:22 2020 -0300 Fix inline frame unwinding breakage commit 991a3e2e9944a4b3a27bd989ac03c18285bd545d Date: Sat Apr 25 00:32:44 2020 -0300 Fix remaining inline/tailcall unwinding breakage for x86_64 gdb/ChangeLog: PR python/22748 * dwarf2/frame-tailcall.c (dwarf2_tailcall_sniffer_first): Remove special handling for inline frames. * findvar.c (value_of_register_lazy): Skip inline frames when creating lazy register values. * frame.c (frame_id_computed_p): Delete definition. * frame.h (frame_id_computed_p): Delete declaration. gdb/testsuite/ChangeLog: PR python/22748 * gdb.opt/inline-frame-tailcall.c: New file. * gdb.opt/inline-frame-tailcall.exp: New file. * gdb.python/py-unwind-inline.c: New file. * gdb.python/py-unwind-inline.exp: New file. * gdb.python/py-unwind-inline.py: New file.
2020-07-06gdb/python: New method to access list of register groupsAndrew Burgess10-0/+371
Add a new method gdb.Architecture.register_groups which returns a new object of type gdb.RegisterGroupsIterator. This new iterator then returns objects of type gdb.RegisterGroup. Each gdb.RegisterGroup object just wraps a single reggroup pointer, and (currently) has just one read-only property 'name' that is a string, the name of the register group. As with the previous commit (adding gdb.RegisterDescriptor) I made gdb.RegisterGroup an object rather than just a string in case we want to add additional properties in the future. gdb/ChangeLog: * NEWS: Mention additions to Python API. * python/py-arch.c (archpy_register_groups): New function. (arch_object_methods): Add 'register_groups' method. * python/py-registers.c (reggroup_iterator_object): New struct. (reggroup_object): New struct. (gdbpy_new_reggroup): New function. (gdbpy_reggroup_to_string): New function. (gdbpy_reggroup_name): New function. (gdbpy_reggroup_iter): New function. (gdbpy_reggroup_iter_next): New function. (gdbpy_new_reggroup_iterator): New function (gdbpy_initialize_registers): Register new types. (reggroup_iterator_object_type): Define new Python type. (gdbpy_reggroup_getset): New static global. (reggroup_object_type): Define new Python type. * python/python-internal.h gdb/testsuite/ChangeLog: * gdb.python/py-arch-reg-groups.exp: New file. gdb/doc/ChangeLog: * gdb.texi (Registers): Add @anchor for 'info registers <reggroup>' command. * python.texi (Architectures In Python): Document new register_groups method. (Registers In Python): Document two new object types related to register groups.
2020-07-06gdb/python: Add gdb.Architecture.registers methodAndrew Burgess11-0/+452
This commit adds a new method gdb.Architecture.registers that returns an object of the new type gdb.RegisterDescriptorIterator. This iterator returns objects of the new type gdb.RegisterDescriptor. A RegisterDescriptor is not a way to read the value of a register, this is already covered by Frame.read_register, a RegisterDescriptor is simply a way to discover from Python, which registers are available for a given architecture. I did consider just returning a string, the name of each register, instead of a RegisterDescriptor, however, I'm aware that it we don't want to break the existing Python API in any way, so if I return just a string now, but in the future we want more information about a register then we would have to add a second API to get that information. By going straight to a descriptor object now, it is easy to add additional properties in the future should we wish to. Right now the only property of a register that a user can access is the name of the register. In future we might want to be able to ask the register about is register groups, or its type. gdb/ChangeLog: * Makefile.in (SUBDIR_PYTHON_SRCS): Add py-registers.c * python/py-arch.c (archpy_registers): New function. (arch_object_methods): Add 'registers' method. * python/py-registers.c: New file. * python/python-internal.h (gdbpy_new_register_descriptor_iterator): Declare. (gdbpy_initialize_registers): Declare. * python/python.c (do_start_initialization): Call gdbpy_initialize_registers. * NEWS: Mention additions to the Python API. gdb/testsuite/ChangeLog: * gdb.python/py-arch-reg-names.exp: New file. gdb/doc/ChangeLog: * python.texi (Python API): Add new section the menu. (Frames In Python): Add new @anchor. (Architectures In Python): Document new registers method. (Registers In Python): New section.
2020-07-06gdb/python: Add architecture method to gdb.PendingFrameAndrew Burgess7-1/+54
It could be useful to determine the architecture of a frame being unwound during the frame unwind process, that is, before we have a gdb.Frame, but when we only have a gdb.PendingFrame. The PendingFrame already has a pointer to the gdbarch internally, this commit just exposes an 'architecture' method to Python, and has this return a gdb.Architecture object (list gdb.Frame.architecture does). gdb/ChangeLog: * NEWS: Mention new Python API method. * python/py-unwind.c (pending_framepy_architecture): New function. (pending_frame_object_methods): Add architecture method. gdb/testsuite/ChangeLog: * gdb.python/py-unwind.py (TestUnwinder::__call__): Add test for gdb.PendingFrame.architecture method. gdb/doc/ChangeLog: * python.texi (Unwinding Frames in Python): Document PendingFrame.architecture method.
2020-07-06gdb: Remove deprecated_set_gdbarch_dataAndrew Burgess6-68/+33
There are currently two remaining uses of deprecated_set_gdbarch_data, both of which are needed because during gdbarch initialisation we call gdbarch_data for a data field that is registered using: gdbarch_data_register_post_init (....) However, in both of these cases, the only thing that the call back needs from the gdbarch struct is its obstack. Given this there is nothing stopping us changing the post-init hooks into pre-init hooks. The pre-init hooks don't get passed the full gdbarch, they only get passed its obstack. The IA64 change is completely untested. The user-regs change has been tested a little by locally adding some user-regs to the x86-64 target, and also by running the RISC-V tests, which do use user-regs. gdb/ChangeLog: * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (deprecated_set_gdbarch_data): Delete. (gdbarch_data): Use internal_error for the case where deprecated_set_gdbarch_data was originally needed. * ia64-libunwind-tdep.c (libunwind_descr_init): Update parameters, and use passed in obstack. (libunwind_frame_set_descr): Should no longer get back NULL from gdbarch_data. (_initialize_libunwind_frame): Register as a pre-init gdbarch data type. * user-regs.c (user_regs_init): Update parameters, and use passed in obstack. (user_reg_add): Should no longer get back NULL from gdbarch_data. (_initialize_user_regs): Register as a pre-init gdbarch data type.
2020-07-06[gdb/symtab] Fix line-table end-of-sequence sortingTom de Vries5-6/+30
Consider test-case gdb.dwarf2/dw2-ranges-base.exp. It has (ignoring non-sensical entries that are filtered out by buildsym_compunit::record_line) a line-table for dw2-ranges-base.c like this: ... Line Number Statements: [0x0000014e] Extended opcode 2: set Address to 0x4004ba [0x00000159] Advance Line by 10 to 11 [0x0000015b] Copy [0x0000015c] Advance PC by 12 to 0x4004c6 [0x0000015e] Extended opcode 1: End of Sequence [0x00000161] Extended opcode 2: set Address to 0x4004ae [0x0000016c] Advance Line by 20 to 21 [0x0000016e] Copy [0x0000016f] Advance PC by 12 to 0x4004ba [0x00000171] Extended opcode 1: End of Sequence [0x00000174] Extended opcode 2: set Address to 0x4004a7 [0x0000017f] Advance Line by 30 to 31 [0x00000181] Copy [0x00000182] Advance PC by 7 to 0x4004ae [0x00000184] Extended opcode 1: End of Sequence ... If we disable the sorting in buildsym_compunit::end_symtab_with_blockvector, we have the unsorted line table: ... INDEX LINE ADDRESS IS-STMT 0 11 0x00000000004004ba Y 1 END 0x00000000004004c6 Y 2 21 0x00000000004004ae Y 3 END 0x00000000004004ba Y 4 31 0x00000000004004a7 Y 5 END 0x00000000004004ae Y ... It contains 3 sequences, 11/END, 21/END and 31/END. We want to sort the 3 sequences relative to each other, while sorting on address, to get: ... INDEX LINE ADDRESS IS-STMT 0 31 0x00000000004004a7 Y 1 END 0x00000000004004ae Y 2 21 0x00000000004004ae Y 3 END 0x00000000004004ba Y 4 11 0x00000000004004ba Y 5 END 0x00000000004004c6 Y ... However, if we re-enable the sorting, we have instead: ... INDEX LINE ADDRESS IS-STMT 0 31 0x00000000004004a7 Y 1 21 0x00000000004004ae Y 2 END 0x00000000004004ae Y 3 11 0x00000000004004ba Y 4 END 0x00000000004004ba Y 5 END 0x00000000004004c6 Y ... This is a regression since commit 3d92a3e313 "gdb: Don't reorder line table entries too much when sorting", that introduced sorting on address while keeping entries with the same address in pre-sort order. Indeed the entries 1 and 2 are in pre-sort order (they map to entries 2 and 5 in the unsorted line table), but entry 1 does not belong in the sequence terminated by 2. Fix this by handling End-Of-Sequence entries in the sorting function, such that they are sorted before other entries with the same address. Also, revert the find_pc_sect_line workaround introduced in commit 3d92a3e313, since that's no longer necessary. Tested on x86_64-linux. gdb/ChangeLog: 2020-07-06 Tom de Vries <tdevries@suse.de> * buildsym.c (buildsym_compunit::end_symtab_with_blockvector): Handle End-Of-Sequence in lte_is_less_than. * symtab.c (find_pc_sect_line): Revert change from commit 3d92a3e313 "gdb: Don't reorder line table entries too much when sorting". gdb/testsuite/ChangeLog: 2020-07-06 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/dw2-ranges-base.exp: Test line-table order.
2020-07-06x86: adjust/correct VFRCZ{P,S}{S,D} decodingJan Beulich2-12/+48
The unnecessary XOP.L decoding had caught my eye, together with the not really expected operand specifiers. Drop this decode step, and instead make sure XOP.W and XOP.PP don't get ignored. For the latter, do this in a form applicable to all XOP insns, rather than adding extra table layers - there are no encodings with the field non-zero. Besides these two, for the scalar forms XOP.L actually needs to also be zero.