aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-10PR26597, FAIL: gdb.dlang/demangle.exp: _D8demangle4testFI5identZvAlan Modra2-2/+7
gcc commit 387d0773f3 changed the D demangler, with the following commit log: libiberty: Add support for `in' and `in ref' storage classes. The storage class `in' is now a first-class citizen with its own mangle symbol, of which also permits `in ref'. Previously, `in' was an alias to `const [scope]', which is a type constructor. The mangle symbol repurposed for this is `I', which was originally used by identifier types. However, while TypeIdentifier is part of the grammar, it must be resolved to some other entity during the semantic passes, and so shouldn't appear anywhere in the mangled name. Old tests that are now no longer valid have been removed. This patch makes the same changes to the gdb testsuite as were made to the upstream gcc libiberty testsuite. gdb/testsuite/ PR 26597 * gdb.dlang/demangle.exp: Update tests as per gcc commit 387d0773f3.
2020-09-10Add minimal and functional NetBSD/amd64 gdbserverKamil Rytarowski6-0/+1686
Implement the following functionality: create_inferior, post_create_inferior, attach, kill, detach, mourn, join, thread_alive, resume, wait, fetch_registers, store_registers, read_memory, write_memory, request_interrupt, supports_read_auxv, read_auxv, supports_hardware_single_step, sw_breakpoint_from_kind, supports_z_point_type, insert_point, remove_point, stopped_by_sw_breakpoint, supports_qxfer_siginfo, qxfer_siginfo, supports_stopped_by_sw_breakpoint, supports_non_stop, supports_multi_process, supports_fork_events, supports_vfork_events, supports_exec_events, supports_disable_randomization, supports_qxfer_libraries_svr4, qxfer_libraries_svr4, supports_pid_to_exec_file, pid_to_exec_file, thread_name, supports_catch_syscall. The only CPU architecture supported: x86_64. Implement only support for hardware assisted single step and software breakpoint. Implement support only for regular X86 registers, thus no FPU. gdbserver/ChangeLog: * netbsd-low.cc: Add. * netbsd-low.h: Likewise. * netbsd-amd64-low.cc: Likewise. * Makefile.in (SFILES): Register "netbsd-low.cc", "netbsd-low.h", "netbsd-amd64-low.cc". * configure.srv: Add x86_64-*-netbsd*.
2020-09-10Switch local native code to gdb/nat shared functionsKamil Rytarowski2-134/+24
No functional change as the same functionality inlined in nbsd-nat.c is offered in gdb/nat/netbsd-nat.c. gdb/ChangeLog: * nbsd-nat.c: Include "nat/netbsd-nat.h". * (nbsd_nat_target::pid_to_exec_file) (nbsd_nat_target::thread_alive, nbsd_nat_target::thread_name) (nbsd_nat_target::post_startup_inferior) (nbsd_nat_target::post_attach, nbsd_nat_target::xfer_partial) (nbsd_add_threads): Switch local code to common gdb/nat functions. * (nbsd_pid_to_cmdline): Call sysctl from the global namespace. * (nbsd_thread_lister): Remove.
2020-09-10Avoid double free in startup_inferiorKamil Rytarowski2-1/+8
Do not free the last execd pathname as it will be used in prepare_resume_reply(), after attaching a client side. gdb/ChangeLog: * fork-inferior.c (startup_inferior): Avoid double free.
2020-09-10Add a common utility function to read and write siginfo_t in inferiorKamil Rytarowski3-0/+44
gdb/ChangeLog: * netbsd-nat.h (netbsd_nat::qxfer_siginfo): Add. * netbsd-nat.c (netbsd_nat::qxfer_siginfo): Likewise.
2020-09-10Add netbsd_nat::enable_proc_events in gdb/natKamil Rytarowski3-0/+31
Add generic function to enable debugger events in a process. gdb/ChangeLog: * netbsd-nat.h (netbsd_nat::enable_proc_events): Add. * netbsd-nat.c: Include <sys/ptrace.h>. * (netbsd_nat::enable_proc_events): Add.
2020-09-10Add gdb/nat common functions for listing threadsKamil Rytarowski3-0/+156
Add netbsd_nat::netbsd_thread_lister a generic thread lister, used internally in netbsd-nat.c, copied from gdb/nbsd-nat.c. Add public extern functions for listing threads: * netbsd_nat::thread_alive * netbsd_nat::thread_name * netbsd_nat::for_each_thread gdb/ChangeLog: * netbsd-nat.h: Include "gdbsupport/function-view.h". * (netbsd_nat::thread_alive, netbsd_nat::thread_name) (netbsd_nat::for_each_thread): Add. * netbsd-nat.c: Include "gdbsupport/common-defs.h" and "gdbsupport/common-debug.h". * (netbsd_nat::netbsd_thread_lister) (netbsd_nat::thread_alive, netbsd_nat::thread_name) (netbsd_nat::for_each_thread): Add.
2020-09-10Add netbsd_nat::pid_to_exec_fileKamil Rytarowski3-0/+32
gdb/ChangeLog: * netbsd-nat.h: Include <unistd.h>. * (netbsd_nat::pid_to_exec_file): Add. * netbsd-nat.c: Include <sys/types.h> and <sys/sysctl.h>. * (netbsd_nat::pid_to_exec_file) Add.
2020-09-10Build nat/netbsd-nat.o for the NetBSD native targetKamil Rytarowski2-1/+5
gdb/ChangeLog: * configure.nat (NATDEPFILES): Add nat/netbsd-nat.o when needed.
2020-09-10Register a placeholder for NetBSD shared functions in gdb/natKamil Rytarowski3-0/+56
gdb/ChangeLog: * netbsd-nat.h: New file. * netbsd-nat.c: Likewise.
2020-09-10Add handle_eintr to wrap EINTR handling in syscallsKamil Rytarowski2-0/+71
gdbsupport/ChangeLog: * eintr.h: New file.
2020-09-10Stop symbols generated by the annobin gcc plugin from breaking the ↵Nick Clifton2-0/+31
disassembly of PowerPC binaries. * ppc-dis.c (ppc_symbol_is_valid): New function. Returns false for hidden, local, no-type symbols. (disassemble_init_powerpc): Point the symbol_is_valid field in the info structure at the new function.
2020-09-10CSKY: Enable extend lrw by default for CK802, CK803 and CK860.Cooper Qu2-1/+9
gas/ * config/tc-csky.c (md_begin): Enable extend lrw by default for CK802, CK803 and CK860.
2020-09-10CSKY: Add L2Cache instructions for CK860.Cooper Qu3-110/+125
opcodes/ * csky-opc.h (csky_v2_opcodes): Add L2Cache instructions. * testsuite/gas/csky/cskyv2_ck860.d : Adjust to icache.iva opcode fixing.
2020-09-10CSKY: Add new arches while refine the cpu option process.Cooper Qu4-172/+474
Add arches CK804, CK805 and CK800. CK800 is an special arch which support all instructions for CSKYV2. Refine the cpu tables to simplify adding a new cpu. Co-Authored-By: Lifang Xia <lifang_xia@c-sky.com> gas/ * config/tc-csky.c (struct csky_cpu_info): Add new members isa_flag, features and ver. (struct csky_cpu_feature): New. (struct csky_cpu_version): New. (CSKY_FEATURE_MAX): Define. (CSKY_CPU_REVERISON_MAX): Define. (FEATURE_DSP_EXT, FEATURE_DSP, FEATURE_MMU, FEATURE_VDSP, FEATURE_FLOAT, FEATURE_TRUST, FEATURE_JAVA, FEATURE_SHIELD): Define, each standard one collection of instructions. (CSKY_FEATURES_DEF_NULL, CSKY_FEATURES_DEF_e, CSKY_FEATURES_DEF_t, CSKY_FEATURES_DEF_f, CSKY_FEATURES_DEF_v, CSKY_FEATURES_DEF_ef, CSKY_FEATURES_DEF_jt, CSKY_FEATURES_DEF_efht, CSKY_FEATURES_DEF_efv, CSKY_FEATURES_DEF_eft, CSKY_FEATURES_DEF_d, CSKY_FEATURES_DEF_df, CSKY_FEATURES_DEF_ft, CSKY_FEATURES_DEF_tv, CSKY_FEATURES_DEF_fv, CSKY_FEATURES_DEF_dft, CSKY_FEATURES_DEF_dfv, CSKY_FEATURES_DEF_ftv, CSKY_FEATURES_DEF_eftv): Define, the features combination used by cpu. (CSKY_CPU_REVERISON_r0p0, CSKY_CPU_REVERISON_r1p0, CSKY_CPU_REVERISON_r2p0, CSKY_CPU_REVERISON_r3p0, CSKY_CPU_REVERISON_RESERVED, CSKY_CPU_REVERISON_R3): Define, version information used by cpu. (csky_cpus): Refine, and add CK804, CK805 and CK800. (parse_cpu): Refine. (parse_arch): Refine. (md_show_usage): Refine. (md_begin): Refine. include/ * opcode/csky.h (CSKY_ARCH_804): Define. (CSKY_ARCH_805): Define. (CSKY_ARCH_800): Define.
2020-09-10Re: PR26580, Size and alignment of commons vs as-needed shared libAlan Modra2-1/+5
Some MIPS targets, for reasons I didn't analyse, use the larger common symbol in a shared lib rather than a smaller common in an executable. That doesn't seem unreasonable, so allow that to pass for pr26580-2. bfin-elf complains about not supporting copy relocs, but it's quite silly to want a copy reloc for common symbols, so leave the fail there. mn10300-elf and score-elf both fail the test with "PHDR segment not covered by LOAD segment". Other tests fail similarly so one more doesn't hurt. The failure is a consequence of supporting dynamic objects but setting EMBEDDED in ld scripts. PR 26580 * testsuite/ld-elf/pr26580-2.sd: Accept undefined symbol.
2020-09-10Re: lto-18 testAlan Modra4-4/+21
Extend the test a little to archives, not that we expect this to fail. Nor has the lto-18 test ever failed without -flto. * testsuite/ld-plugin/lto-18b.c (select): Remove. * testsuite/ld-plugin/lto-18c.c (select): Remove. * testsuite/ld-plugin/lto.exp: Build archives for lto-18 too, and run static versions of the test.
2020-09-10Fix compile time warnings when building for the CSKY target on a 32-bit host.Nick Clifton4-2/+12
incldue * opcode/csky.h (CSKY_ISA_FLOAT_7E60): Use a long long type for this value. opcodes * csky-dis.c (csky_output_operand): Coerce the immediate values to long before printing.
2020-09-10sprintf arg overlaps destinationAlan Modra2-4/+8
* csky-dis.c (csky_output_operand): Don't sprintf str to itself.
2020-09-10Automatic date update in version.inGDB Administrator1-1/+1
2020-09-09Fix latent bug in ada-lang.c:remove_extra_symbolsTom Tromey2-2/+7
I believe ada-lang.c:remove_extra_symbols has a latent bug. This function loops over a vector of symbols, removing duplicates according to some criteria. At the end of the loop it does: if (remove_p) syms->erase (syms->begin () + i); i += 1; However, this seems wrong to me -- when removing the i'th element, this code still increments "i", thus skipping an element. At first I thought this was a regression from the patches to remove cleanups from ada-lang.c (this was when std::vector was introduced); but I found that instead the bug seems to be older: if (remove_p) { for (j = i + 1; j < nsyms; j += 1) syms[j - 1] = syms[j]; nsyms -= 1; } i += 1; No test, as I don't know how to write one. As this is Ada-specific, and was already reviewed internally by Joel, I am checking it in. gdb/ChangeLog 2020-09-09 Tom Tromey <tromey@adacore.com> * ada-lang.c (remove_extra_symbols): Do not increment when removing an element
2020-09-09Fix thinko in the code to check coff archive elements.Nick Clifton2-4/+9
* cofflink.c (coff_link_check_archive_element): Move the check for coff type input to the start of the function.
2020-09-09power10 on ppc32Alan Modra2-1/+7
We don't support power10 on ppc32, mainly because some instructions have 34-bit fields for which we don't have relocations on ppc32. If you try to assemble typical code, you'll see errors saying "reloc ... not supported by object file format". Also, on 32-bit hosts with binutils configured without a 64-bit bfd, you'll see errors saying "bignum invalid" when using large offsets. But let's not kill output of prefix insns entirely on 32-bit hosts. * config/tc-ppc.c (md_assemble): Emit prefix insn by parts when valueT is smaller than 64 bits.
2020-09-09CSKY: Change mvtc and mulsw's ISA flag.Cooper Qu6-4/+19
gas/ * config/tc-csky.c (CSKYV2_ISA_DSP): CSKY_ISA_DSPE60. (CSKY_ISA_860): Likewise. include/ * opcode/csky.h (CSKY_ISA_DSPE60): Define. opcodes/ * csky-opc.h (csky_v2_opcodes): Change mvtc and mulsw's ISA flag.
2020-09-09CSKY: Support option -mfloat-abi.Cooper Qu2-0/+67
The option corresponds to GCC to control the float calling conversion, and the value will be stored in .csky.attributes section. Co-Authored-By: Lifang Xia <lifang_xia@c-sky.com> gas/ * config/tc-csky.c (float_abi): New. (md_longopts): Add mfloat-abi. (struct sky_option_value_table): New. (csky_float_abis): New, the possible values for -mfloat-abi. (parse_float_abi): New funtion. (md_show_usage): Show help information for -mfloat-abi. (set_csky_attribute): Store float-abi value.
2020-09-09CSKY: Add FPUV3 instructions, which supported by ck860f.Cooper Qu7-33/+2356
Co-Authored-By: Lifang Xia <lifang_xia@c-sky.com> gas/ * config/tc-csky.c (float_work_fpuv3_fmovi): New function, helper function to encode fpuv3 fmovi instructions. (float_work_fpuv3_fstore): New function. (struct literal): Add new member 'offset'. (csky_cpus): New cpu CK860f. (enter_literal): Return literal pool pointer instead of offset. (parse_rt): Adjust the change of enter_literal. (parse_rtf): Likewise. (v1_work_lrw): Likewise. (v1_work_jbsr): Likewise. (v2_work_lrw): Likewise. (v2_work_jbsr): Likewise. (v2_work_jsri): Likewise. (vdsp_work_vlrw): Likewise. (is_freglist_legal): Add handler for FPUV3. (parse_type_freg): Likewise. (is_imm_within_range): Set e.X_add_number if it is a signed and negtive number. (get_operand_value): Add handler for OPRND_TYPE_IMM9b, OPRND_TYPE_HFLOAT_FMOVI, OPRND_TYPE_SFLOAT_FMOVI and OPRND_TYPE_DFLOAT_FMOVI. (float_to_half): Convert float number to harf float. opcodes/ * csky-dis.c (csky_output_operand): Add handlers for OPRND_TYPE_HFLOAT_FMOVI, OPRND_TYPE_SFLOAT_FMOVI and OPRND_TYPE_DFLOAT_FMOVI. Refine OPRND_TYPE_FREGLIST_DASH to support FPUV3 instructions. * csky-opc.h (enum operand_type): New enum OPRND_TYPE_IMM9b, OPRND_TYPE_HFLOAT_FMOVI, OPRND_TYPE_SFLOAT_FMOVI and OPRND_TYPE_DFLOAT_FMOVI. (OPRND_MASK_4_5, OPRND_MASK_6, OPRND_MASK_6_7, OPRND_MASK_6_8, OPRND_MASK_7, OPRND_MASK_7_8, OPRND_MASK_17_24, OPRND_MASK_20, OPRND_MASK_20_21, OPRND_MASK_20_22, OPRND_MASK_20_23, OPRND_MASK_20_24, OPRND_MASK_20_25, OPRND_MASK_0_3or5_8, OPRND_MASK_0_3or6_7, OPRND_MASK_0_3or25, OPRND_MASK_0_4or21_24, OPRND_MASK_5or20_21, OPRND_MASK_5or20_22, OPRND_MASK_5or20_23, OPRND_MASK_5or20_24, OPRND_MASK_5or20_25, OPRND_MASK_8_9or21_25, OPRND_MASK_8_9or16_25, OPRND_MASK_4_6or20, OPRND_MASK_5_7or20, OPRND_MASK_4_5or20or25, OPRND_MASK_4_6or20or25, OPRND_MASK_4_7or20or25, OPRND_MASK_6_9or17_24, OPRND_MASK_6_7or20, OPRND_MASK_6or20, OPRND_MASK_7or20, OPRND_MASK_5or8_9or16_25, OPRND_MASK_5or8_9or20_25): Define. (csky_v2_opcodes): Add FPUV3 instructions. include/ * opcode/csky.h (CSKY_ISA_FLOAT_7E60): Define.
2020-09-09PR26578, memory leak in parse_gnu_debugaltlinkAlan Modra2-7/+8
The associated check function doesn't do anything with its "data" param, so nothing to adjust there. PR 26578 * dwarf.c (parse_gnu_debugaltlink): Don't alloc build_id_data. (load_separate_debug_files): Use a stack var for build_id_data.
2020-09-09lto-18 testAlan Modra7-4/+74
Demonstrates a reason to use IR symbols when deciding an --as-needed library should be loaded. * testsuite/ld-plugin/lto-18a.c, * testsuite/ld-plugin/lto-18b.c, * testsuite/ld-plugin/lto-18c.c, * testsuite/ld-plugin/lto-18d.c, * testsuite/ld-plugin/lto-18.out: New test. * testsuite/ld-plugin/lto.exp: Run it.
2020-09-09Automatic date update in version.inGDB Administrator1-1/+1
2020-09-09Re: MSP430: Support relocations for subtract expressions in .uleb128 directivesAlan Modra3-2/+9
Put the prototype where it won't disappear on the next regen of libbfd.h. * libbfd-in.h (_bfd_write_unsigned_leb128): Declare. * libbfd.h: Regenerate.
2020-09-08bpf: simulator: correct div, mod insn semanticsDavid Faust8-35/+73
The div and mod eBPF instructions are unsigned, but the semantic specification for the simulator incorrectly used signed operators. Correct them to unsigned versions, and correct the ALU tests in the simulator (which incorrectly assumed signed semantics). Tested in bpf-unknown-none. cpu/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * bpf.cpu (define-alu-instructions): Correct semantic operators for div, mod to unsigned versions. sim/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * bpf/sem-be.c: Regenerate. * bpf/sem-le.c: Likewise. sim/testsuite/ChangeLog: 2020-09-08 David Faust <david.faust@oracle.com> * sim/bpf/alu.s: Correct div and mod tests. * sim/bpf/alu32.s: Likewise.
2020-09-08Pass --disable-reloc-section on PE targets for PR 25662 testH.J. Lu2-1/+12
Pass --disable-reloc-section on PE targets for PR 25662 test since commit 514b4e191d5f46de8e142fe216e677a35fa9c4bb Author: Jeremy Drake <sourceware-bugzilla@jdrake.com> Date: Thu Aug 27 12:58:27 2020 +0100 Change the default characteristics of DLLs built by the linker to more secure settings. defaulted to --enable-reloc-section. PR ld/26587 * testsuite/binutils-all/objcopy.exp: Pass --disable-reloc-section to ld on PE targets for PR 25662 test.
2020-09-08Do not adjust mtime timezone on WindowsTom Tromey5-3/+25
PR win32/25302 notes that gdb will crash when trying to "run" even a simple program on Windows. The essential bug here is that the BFD cache can easily be corrupted -- I have sent a separate patch for that. The particular reason that the cache is corrupted on Windows is that gnulib overrides "stat" to make it do timezone adjustment -- but BFD does not use this version of stat. The difference here triggers the latent cache bug, but can also cause other bugs as well; in particular it can cause spurious warnings about source files being newer. This patch simply removes the stat override on mingw, making gnulib and BFD agree. I tested this by backing out the local AdaCore changes to work around this bug and then verifying that I could reproduce it. Then, I applied this patch and verified that "run" works again. 2020-09-08 Tom Tromey <tromey@adacore.com> PR win32/25302: * update-gnulib.sh: Apply stat patch. * patches/0001-use-windows-stat: New file. * import/m4/stat.m4: Update. * configure: Rebuild.
2020-09-08Fix uninitialized warning in gdb_bfd_openTom Tromey2-3/+9
The previous patch introduced an uninitialized warning in gdb_bfd_open. The problem was that "abfd" was being used without being initialized. This patch fixes the problem by calling bfd_fopen in the branch where "fstat" has failed. gdb/ChangeLog 2020-09-08 Tom Tromey <tromey@adacore.com> * gdb_bfd.c (gdb_bfd_open): Call bfd_fopen when fstat fails.
2020-09-08Avoid hash table corruption in gdb_bfd.cTom Tromey2-42/+61
gdb caches BFDs that come from ordinary files. This code turns out to have a bug where the hash table can become corrupted, causing gdb to crash. When gdb_bfd_open opens the BFD, it uses fstat to get the BFD's mtime. This is used when inserting the entry into gdb_bfd_cache. Then, the function creates the gdb_bfd_data object as a side effect of calling new_reference. This object is used when finding objects in the hash table, and its constructor uses bfd_get_mtime. So, if the file changes between the time the BFD is put into the cache and the time that this object is created, the hash table will be incorrect. When the BFD is later deleted, its entry in the hash table will not be found, and at this point the hash table will point to invalid memory. This patch fixes the bug by ensuring that the mtime, and other relevant attributes comgin from stat, that are used for insertion are also used when creating the gdb_bfd_data. This obsoletes an earlier patch that had split this into two parts (surrounding a patch to use bfd_stat more consistently). This version merges the two patches, in the interest of correctness. gdb/ChangeLog 2020-09-08 Tom Tromey <tromey@adacore.com> PR win32/25302: * gdb_bfd.c (gdb_bfd_data): Add "st" parameter. (gdb_bfd_init_data): New function. (gdb_bfd_open, gdb_bfd_ref): Use gdb_bfd_init_data.
2020-09-08MSP430: Support relocations for subtract expressions in .uleb128 directivesJozef Lawrynowicz17-10/+362
Link-time relaxations of branches are common for MSP430, given that GCC can generate pessimal branch instructions, and the -mcode-region=either/-mdata-region=either options to shuffle sections can further change the type of branch instruction required. These relaxations can result in invalid code when .uleb128 directives, used in the .gcc_except_table section, are used to calculate the distance between two labels. A value for the .uleb128 directive is calculated at assembly-time, and can't be updated at link-time, even if relaxation causes the distance between the labels to change. This patch adds relocations for subtract expressions in .uleb128 directives, to allow the linker to re-calculate the value of these expressions after relaxation has been performed. bfd/ChangeLog: * bfd-in2.h (bfd_reloc_code_real): Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128. * elf32-msp430.c (msp430_elf_ignore_reloc): New. (elf_msp430_howto_table): Add R_MSP430{,X}_GNU_{SET,SUB}_ULEB128. (msp430_reloc_map): Add R_MSP430_GNU_{SET,SUB}_ULEB128. (msp430x_reloc_map): Add R_MSP430X_GNU_{SET,SUB}_ULEB128. (write_uleb128): New. (msp430_final_link_relocate): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128. * libbfd.c (_bfd_write_unsigned_leb128): New. * libbfd.h (_bfd_write_unsigned_leb128): New prototype. Add BFD_RELOC_MSP430_{SET,SUB}_ULEB128. * reloc.c: Document BFD_RELOC_MSP430_{SET,SUB}_ULEB128. binutils/ChangeLog: * readelf.c (target_specific_reloc_handling): Handle R_MSP430{,X}_GNU_{SET,SUB}_ULEB128. gas/ChangeLog: * config/tc-msp430.c (msp430_insert_uleb128_fixes): New. (msp430_md_end): Call msp430_insert_uleb128_fixes. include/ChangeLog: * elf/msp430.h (elf_msp430_reloc_type): Add R_MSP430_GNU_{SET,SUB}_ULEB128. (elf_msp430x_reloc_type): Add R_MSP430X_GNU_{SET,SUB}_ULEB128. ld/ChangeLog: * testsuite/ld-msp430-elf/msp430-elf.exp: Run new tests. * testsuite/ld-msp430-elf/uleb128.s: New test. * testsuite/ld-msp430-elf/uleb128_430.d: New test. * testsuite/ld-msp430-elf/uleb128_430x.d: New test.
2020-09-08aarch64: Add -mcpu option for Cortex-R82Alex Coplan3-1/+8
This adds support for the Arm Cortex-R82 CPU in AArch64 GAS. For more information about this processor, see [0]. [0] : https://developer.arm.com/ip-products/processors/cortex-r/cortex-r82 gas/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * config/tc-aarch64.c (aarch64_cpus): Add Cortex-R82. * doc/c-aarch64.texi: Document -mcpu=cortex-r82.
2020-09-08aarch64: Add support for Armv8-R system registersAlex Coplan14-16/+597
This patch adds support for the system registers introduced in Armv8-R AArch64. gas/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * config/tc-aarch64.c (parse_sys_reg): Also pass sysreg name to validation function. (parse_sys_ins_reg): Likewise. (print_operands): Pass CPU features to aarch64_print_operand(). * testsuite/gas/aarch64/v8-r-bad-sysregs.d: New test. * testsuite/gas/aarch64/v8-r-bad-sysregs.l: Error output. * testsuite/gas/aarch64/v8-r-bad-sysregs.s: Input. * testsuite/gas/aarch64/v8-r-sysregs-need-arch.d: New test. * testsuite/gas/aarch64/v8-r-sysregs-need-arch.l: Error output. * testsuite/gas/aarch64/v8-r-sysregs.d: New test. * testsuite/gas/aarch64/v8-r-sysregs.s: Input for previous two tests. include/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * opcode/aarch64.h (aarch64_sys_ins_reg_supported_p): Also take system register name in order to simplify validation for v8-R. (aarch64_print_operand): Also take CPU feature set, as disassembly for system registers now depends on arch variant. opcodes/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * aarch64-dis.c (print_operands): Pass CPU features to aarch64_print_operand(). * aarch64-opc.c (aarch64_print_operand): Use CPU features to determine preferred disassembly of system registers. (SR_RNG): Refactor to use new SR_FEAT2 macro. (SR_FEAT2): New. (SR_V8_1_A): New. (SR_V8_4_A): New. (SR_V8_A): New. (SR_V8_R): New. (SR_EXPAND_ELx): New. (SR_EXPAND_EL12): New. (aarch64_sys_regs): Specify which registers are only on A-profile, add R-profile system registers. (ENC_BARLAR): New. (PRBARn_ELx): New. (PRLARn_ELx): New. (aarch64_sys_ins_reg_supported_p): Reject EL3 registers for Armv8-R AArch64.
2020-09-08aarch64: Add support for Armv8-R DFB aliasAlex Coplan8-1367/+1400
This adds support for the DFB alias introduced in Armv8-R AArch64. gas/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * testsuite/gas/aarch64/dfb.d: New test. * testsuite/gas/aarch64/dfb.s: Input. opcodes/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * aarch64-tbl.h (aarch64_feature_v8_r): New. (ARMV8_R): New. (V8_R_INSN): New. (aarch64_opcode_table): Add dfb. * aarch64-opc-2.c: Regenerate. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate.
2020-09-08aarch64: Add base support for Armv8-RAlex Coplan11-3/+76
This patch adds the basic infrastructure needed to support Armv8-R in AArch64 binutils: new command-line flags, new feature bits, a new BFD architecture, and support for differentiating between architecture variants in the disassembler. The new command-line options added by this patch are -march=armv8-r in GAS and -m aarch64:armv8-r in objdump. The disassembler support is necessary since Armv8-R AArch64 introduces a system register (VSCTLR_EL2) which shares an encoding with a different system register (TTBR0_EL2) in Armv8-A. This also allows us to use the correct preferred disassembly for the new DFB alias introduced in Armv8-R. bfd/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * archures.c (bfd_mach_aarch64_8R): New. * bfd-in2.h: Regenerate. * cpu-aarch64.c (bfd_aarch64_arch_v8_r): New. (bfd_aarch64_arch_ilp32): Update tail pointer. gas/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * config/tc-aarch64.c (aarch64_archs): Add armv8-r. * doc/c-aarch64.texi: Document -march=armv8-r. include/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * opcode/aarch64.h (AARCH64_FEATURE_V8_A): New. (AARCH64_FEATURE_V8_R): New. (AARCH64_ARCH_V8): Include new A-profile feature bit. (AARCH64_ARCH_V8_R): New. opcodes/ChangeLog: 2020-09-08 Alex Coplan <alex.coplan@arm.com> * aarch64-dis.c (arch_variant): New. (determine_disassembling_preference): Disassemble according to arch variant. (select_aarch64_variant): New. (print_insn_aarch64): Set feature set.
2020-09-08PR26580, Size and alignment of commons vs as-needed shared libAlan Modra13-50/+159
Two pieces to this puzzle: 1) Revert HJ's fix for PR13250 so that size and alignment isn't sticky, instead attack the real underlying problem that _bfd_generic_link_add_one_symbol does the wrong thing in making a common section in a shared library bfd. 2) Save and restore common u.c.p fields, which hold the section and alignment. A better fix for (2) would be to throw away all of that horrible code saving and restoring the hash table when loading as-needed library symbols, and instead do a scan over as-needed library symbols before adding anything. bfd/ PR 13250 PR 26580 * elflink.c (_bfd_elf_merge_symbol): Make "override" a bfd**. Return oldbfd in override when old common should override new common. (_bfd_elf_add_default_symbol): Adjust to suit. (elf_link_add_object_symbols): Likewise. Pass "override" to _bfd_generic_link_add_one_symbol. Save and restore common u.c.p field for --as-needed shared libraries. Revert pr13250 changes. ld/ * testsuite/ld-elf/pr26580-a.s, * testsuite/ld-elf/pr26580-b.s, * testsuite/ld-elf/pr26580-1.sd, * testsuite/ld-elf/pr26580-2.sd: New tests * testsuite/ld-elf/comm-data.exp: Run new tests. * testsuite/ld-elf/pr26580-a.c, * testsuite/ld-elf/pr26580-b.c, * testsuite/ld-elf/pr26580-3.out, * testsuite/ld-elf/pr26580-4.out: New tests. * testsuite/ld-elf/shared.exp: Run new tests.
2020-09-08sync libiberty from gccAlan Modra11-84/+299
config/ Sync from gcc 2020-07-15 H.J. Lu <hjl.tools@gmail.com> PR bootstrap/96202 * cet.m4 (GCC_CET_HOST_FLAGS): Don't enable CET without CET support in stage1 nor for build support. libiberty/ * configure: Regenerate. Sync from gcc 2020-09-08 Alan Modra <amodra@gmail.com> * d-demangle.c: Include limits.h. (ULONG_MAX, UINT_MAX): Provide fall-back definition. (dlang_number): Simplify and correct overflow test. Only write *ret on returning non-NULL. Make "ret" an unsigned long*. Only succeed for result of [0,UINT_MAX]. (dlang_decode_backref): Simplify and correct overflow test. Only write *ret on returning non-NULL. Only succeed for result [1,MAX_LONG]. (dlang_backref): Remove now unnecessary range check. (dlang_symbol_name_p): Likewise. (string_need): Take a size_t n arg, and use size_t tem. (string_append): Use size_t n. (string_appendn, string_prependn): Take a size_t n arg. (TEMPLATE_LENGTH_UNKNOWN): Define as -1UL. (dlang_lname, dlang_parse_template): Take an unsigned long len arg. (dlang_symbol_backref, dlang_identifier, dlang_parse_integer), (dlang_parse_integer, dlang_parse_string), (dlang_parse_arrayliteral, dlang_parse_assocarray), (dlang_parse_structlit, dlang_parse_tuple), (dlang_template_symbol_param, dlang_template_args): Use unsigned long variables. * testsuite/d-demangle-expected: Add new tests. 2020-08-04 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_function_args): Handle 'in' and 'in ref' parameter storage classes. (dlang_type): Remove identifier type. * testsuite/d-demangle-expected: Update tests. 2020-08-03 Richard Biener <rguenther@suse.de> PR lto/96385 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Localize global UNDEFs and reuse the prevailing name. 2020-07-10 Ian Lance Taylor <iant@golang.org> PR demangler/96143 * cp-demangle.c (d_lambda): Don't add substitution candidate. * testsuite/demangle-expected: Update a few existing test cases accordingly, and add a new test case. 2020-07-04 Jason Merrill <jason@redhat.com> * cp-demangle.c (cplus_demangle_operators): Add di, dx, dX. (d_expression_1): Handle di and dX. (is_designated_init, d_maybe_print_designated_init): New. (d_print_comp_inner): Use d_maybe_print_designated_init. * testsuite/demangle-expected: Add designator tests. 2020-06-25 Nick Clifton <nickc@redhat.com> * bsearch.c (bsearch): Remove use of register keyword. * bsearch_r.c (bsearch_r): Likewise.
2020-09-08[gdb/testsuite] Fix gdb.dwarf2/frame-inlined-in-outer-frame.expTom de Vries2-0/+6
I'm running into the following FAIL: ... (gdb) starti ^M Starting program: frame-inlined-in-outer-frame frame^M ^M ^M Program stopped.^M 0x0000000000401000 in _start ()^M (gdb) PASS: gdb.dwarf2/frame-inlined-in-outer-frame.exp: frame frame^M (gdb) FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into foo stepi^M 0x0000000000401001 in foo ()^M ... The problem is that the .exp file issues a gdb_starti_cmd without consuming the resulting prompt. Consequently, the gdb_test issuing the frame command consumes that prompt, and things are out-of-sync from that point onwards. Fix this by consuming the gdb prompt after gdb_starti_cmd. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-09-08 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/frame-inlined-in-outer-frame.exp: Consume gdb prompt after gdb_starti_cmd.
2020-09-08Stop the plugin handler from ignoring unknown symbol types when ↵Nick Clifton2-0/+7
conanicalizing weak definitions. * plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an unrecognized symbol type in a weak definition.
2020-09-08Automatic date update in version.inGDB Administrator1-1/+1
2020-09-07gdb/infrun: use switch_to_target_no_thread to switch the targetTankut Baris Aktemur2-7/+7
Use the available `switch_to_target_no_thread` function to switch the target. This is a refactoring. gdb/ChangeLog: 2020-09-07 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * infrun.c (fetch_inferior_event): Use `switch_to_target_no_thread` to switch the target.
2020-09-07gas: Output directory and file names in .debug_line_str for DWARF5Mark Wielaard3-23/+82
* dwarf2dbg.c (add_line_strp): New function. (out_dir_and_file_list): Take line_seg and sizeof_offset as arguments, Use DW_FORM_line_strp for dir and file. Call add_line_strp and set symbol offset for DWARF2_LINE_VERSION 5. (out_debug_line): Call out_dir_and_file_list with line_seg and sizeof_offset. * gas/testsuite/gas/elf/dwarf-5-file0.d: Expect indirect line strings.
2020-09-07gas: Output .debug_rnglists for DWARF 5.Mark Wielaard2-14/+96
* dwarf2dbg.c (DWARF2_RNGLISTS_VERSION): New constant. (out_debug_ranges): Add ranges_sym argument and set it. (out_debug_rnglists): New function. (out_debug_info): Change ranges_seg argument to ranges_sym and use it to set DW_AT_ranges value. (dwarf2_finish): Remove ranges_seg, add ranges_sym. For DWARF2_VERSION 5 call out_debug_rnglists.
2020-09-07gas: Make sure to only add an md5 to a .file when requested.Mark Wielaard3-2/+8
* dwarf2dbg.c (dwarf2_directive_filename): Initialize with_md5 to FALSE. * gas/testsuite/gas/elf/dwarf-5-file0.s: Add a random bignum.
2020-09-07Automatic date update in version.inGDB Administrator1-1/+1