aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-07-06Add checks for the NT_ARM_SVE section in a core file.Alan Hayward3-0/+37
The NT_ARM_SVE section is documented here: https://github.com/torvalds/linux/blob/master/Documentation/arm64/sve.txt * A NT_ARM_SVE note will be added to each coredump for each thread of the dumped process. The contents will be equivalent to the data that would have been read if a PTRACE_GETREGSET of NT_ARM_SVE were executed for each thread when the coredump was generated. * elf.c (elfcore_grok_aarch_sve): New function. (elfcore_grok_note): Check for Aarch64 SVE. (elfcore_write_aarch_sve): New function. (elfcore_write_register_note): Check for Aarch64 SVE. * elf-bfd.h(elfcore_grok_aarch_sve): New declaration.
2018-07-06Fix SBO bit in disassembly mask for ldrah on AArch64.Tamar Christina2-1/+6
The disassembly mask for ldarh incorrectly didn't mask out bit 20 which is part of the SBO part of the instruction and shouldn't be considered input. This fixes the wrong bit fixing the disassembly of instructions to ldarh and makes the behavior consistent. opcodes/ PR binutils/23242 * aarch64-tbl.h (ldarh): Fix disassembly mask.
2018-07-06Fix the read/write flag for these registers on AArch64Tamar Christina5-5/+44
The previous constraints were based on information already in opcodes and it seems that a few of them were wrong. I have now hand verified the ones changed by the previous patch and corrected where needed. This prevents a warning to be issued when one shouldn't be. opcodes/ PR binutils/23369 * aarch64-opc.c (aarch64_sys_regs): Make read/write csselr_el1, vsesr_el2, osdtrrx_el1, osdtrtx_el1, pmsidr_el1. gas/testsuite/ PR binutils/23369 * gas/aarch64/msr.d (csselr_el1, vsesr_el2, osdtrrx_el1, osdtrtx_el1, pmsidr_el1): New. * gas/aarch64/msr.s: Likewise.
2018-07-06gdb/testsuite: Ensure test links in malloc and freeAndrew Burgess2-0/+8
The test associated with the source file gdb.base/share-env-with-gdbserver.c relies on calling malloc and free within the inferior from GDB. However, as the test source itself makes no use of these functions, there's no requirement that they be linked into the test executable. This commit adds a dummy call to malloc and free to ensure they are linked into the test executable. gdb/testsuite/ChangeLog: * gdb.base/share-env-with-gdbserver.c (main): Add call to malloc/free.
2018-07-06Stop readelf from reporting gaps in the gnu build notes if the gap crosses a ↵Nick Clifton2-2/+28
section boundary. * readelf.c (same_section): New function. (print_gnu_build_attribute_description): Do not complain about gaps that cross a section boundary.
2018-07-06Fix the relocs created to adjust notes created by the assembler.Nick Clifton2-3/+8
* write.c (maybe_generate_build_notes): Bias reloc offsets by the number of notes already generated.
2018-07-06Update config.subSebastian Huber2-9/+7
* config.sub: Sync with upstream version 2018-07-03.
2018-07-06Fix diagnostic errorsAlan Modra9-6/+46
Fixes a number of build errors like the following .../elf32-arm.c: In function 'elf32_arm_nabi_write_core_note': .../elf32-arm.c:2177: error: #pragma GCC diagnostic not allowed inside functions .../elf32-arm.c:2186: error: #pragma GCC diagnostic not allowed inside functions See the comment in diagnostics.h. include/ * diagnostics.h: Comment on macro usage. bfd/ * elf32-arm.c (elf32_arm_nabi_write_core_note): Don't use DIAGNOTIC_PUSH and DIAGNOSTIC_POP unconditionally. * elf32-ppc.c (ppc_elf_write_core_note): Likewise. * elf32-s390.c (elf_s390_write_core_note): Likewise. * elf64-ppc.c (ppc64_elf_write_core_note): Likewise. * elf64-s390.c (elf_s390_write_core_note): Likewise. * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
2018-07-06[GOLD] PowerPC .gnu.attributes supportAlan Modra4-7/+393
elfcpp/ * powerpc.h (Tag_GNU_Power_ABI_FP): Define. (Tag_GNU_Power_ABI_Vector, Tag_GNU_Power_ABI_Struct_Return): Define. gold/ * powerpc.cc: Include attributes.h. (Powerpc_relobj::attributes_section_data_): New variable, with accessor and associated constructor and destructor support. (Powerpc_dynobj::attributes_section_data_): Likewise. (Powerpc_relobj::do_read_symbols): Stash SHT_GNU_ATTRIBUTES section contents in attributes_section_data_. (Powerpc_dynobj::do_read_symbols): Likewise. (Target_powerpc): Add attributes_section_data_, last_fp_, last_ld_, last_vec_, and last_struct_ vars. (Target_powerpc::merge_object_attributes): New function. (Target_powerpc::do_finalize_sections): Iterate over input objects merging attributes. Create output attributes section.
2018-07-05darwin: Silence syscall deprecated declaration warningSimon Marchi4-7/+34
This patch silences this warning: /Users/simark/src/binutils-gdb/gdb/darwin-nat.c:839:10: error: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations] res = syscall (SYS___pthread_kill, thread->gdb_port, nsignal); ^ /usr/include/unistd.h:745:6: note: 'syscall' has been explicitly marked deprecated here int syscall(int, ...); ^ The comment of the new pthread_kill function explains why we use the syscall function directly. include/ChangeLog: * diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS): Define for clang. gdb/ChangeLog: * darwin-nat.c (darwin_pthread_kill): New function. (darwin_resume_thread): Use darwin_pthread_kill.
2018-07-05RISC-V: Add riscv-*-* configure support, and minor cleanup.Jim Wilson4-3/+14
bfd/ * config.bfd (riscv32*-*-*): Renamed from riscv32-*-*. (riscv64*-*-*): Likewise. (riscv-*-*): Add as an alias for riscv32*-*-*. ld/ * configure.tgt (riscv-*-*): Add as an alias for riscv32*-*-*.
2018-07-06Automatic date update in version.inGDB Administrator1-1/+1
2018-07-05MIPS/LD/testsuite: Use $linux_gnu consistently across `mips-elf.exp'Maciej W. Rozycki2-2/+7
Replace two remaining spelled-out calls to `[istarget mips*-*-linux*]' in `mips-elf.exp' with $linux_gnu, which is equivalent. ld/ * testsuite/ld-mips-elf/mips-elf.exp: Replace remaining calls to `[istarget mips*-*-linux*]' with $linux_gnu.
2018-07-05x86: Remove x86 ISA properties with empty bitsH.J. Lu17-4/+230
There is no need to generate x86 ISA properties with empty bits in linker output. bfd/ PR ld/23372 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86 ISA properties with empty bits. ld/ PR ld/23372 * testsuite/ld-i386/i386.exp: Run pr23372a and pr23372b. * testsuite/ld-i386/pr23372a.d: New file. * testsuite/ld-i386/pr23372a.s: Likewise. * testsuite/ld-i386/pr23372b.d: Likewise. * testsuite/ld-i386/pr23372b.s: Likewise. * testsuite/ld-i386/pr23372c.s: Likewise. * testsuite/ld-x86-64/pr23372a-x32.d: Likewise. * testsuite/ld-x86-64/pr23372a.d: Likewise. * testsuite/ld-x86-64/pr23372a.s: Likewise. * testsuite/ld-x86-64/pr23372b-x32.d: Likewise. * testsuite/ld-x86-64/pr23372b.d: Likewise. * testsuite/ld-x86-64/pr23372b.s: Likewise. * testsuite/ld-x86-64/pr23372c.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr23372a, pr23372a-x32, pr23372b and pr23372b-x32.
2018-07-05Update config.guess and config.subSebastian Huber3-748/+755
* config.guess: Sync with upstream version 2018-06-26. * config.sub: Sync with upstream version 2018-07-02.
2018-07-05Updated Russian, Bulgarian, and Brazilian Portuguese translations for ↵Nick Clifton9-11457/+20411
various components of the binutuls. ld * po/bg.po: Updated Bulgarian translation. * po/pt_BR.po: Updated Brazilian Portuguese translation. binutils* po/bg.po: Updated Bulgarian translation. bfd,gas * po/ru.po: Updated Russian translation.
2018-07-05[gdb] Fix build error in macroexp.cTom de Vries2-0/+14
When doing a combined build with the gcc and binutils-gdb repos, I run into this build error in gdb: ... gdb/macroexp.c: \ In function ‘void get_next_token_for_substitution(macro_buffer*, \ macro_buffer*, char**, macro_buffer*, char**, int*, bool*)’: gdb/macroexp.c:925:17: error: \ implicitly-declared ‘constexpr macro_buffer& \ macro_buffer::operator=(const macro_buffer&)’ is deprecated \ [-Werror=deprecated-copy] *token = *lookahead; ... Wdeprecated-copy is a new gcc warning added after gcc 8. This patch fixes the build error by adding an explicit copy operator to the macro_buffer class. I've added asserts to ensure that both the dest and src of the copy are shared, in other words, neither is owner of the text pointer. I've run the gdb testsuite on x86_64-linux and the asserts did not trigger. 2018-07-05 Tom de Vries <tdevries@suse.de> * macroexp.c (macro_buffer) <operator=>: New member function.
2018-07-05Error for mismatched powerpc ABI tagsAlan Modra13-44/+96
And report the two input files that are incompatible rather than reporting that an input file is incompatible with the output. bfd/ * elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype. * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error on mismatch. Remove "warning: " from messages. Track last bfd used to set tags. (ppc_elf_merge_obj_attributes): Likewise. Handle status from _bfd_elf_ppc_merge_fp_attributes. * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status from _bfd_elf_ppc_merge_fp_attributes. ld/ * testsuite/ld-powerpc/attr-gnu-4-12.d: Update expected output. * testsuite/ld-powerpc/attr-gnu-4-13.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-21.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-23.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-31.d: Likewise. * testsuite/ld-powerpc/attr-gnu-4-32.d: Likewise. * testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise. * testsuite/ld-powerpc/attr-gnu-12-21.d: Likewise.
2018-07-05Automatic date update in version.inGDB Administrator1-1/+1
2018-07-04Use exit_inferior in darwin_attach_pidTom Tromey2-2/+5
Commit a50c11c666 was intended to use exit_inferior in darwin_attach_pid, but I accidentally pushed the wrong version of the patch. This fixes the problem. gdb/ChangeLog 2018-07-04 Tom Tromey <tom@tromey.com> * darwin-nat.c (darwin_attach_pid): Use exit_inferior.
2018-07-04darwin: Don't use sbrkSimon Marchi5-4/+20
This patch gets rid of this warning on macOS: CXX main.o /Users/simark/src/binutils-gdb/gdb/main.c:492:27: error: 'sbrk' is deprecated [-Werror,-Wdeprecated-declarations] lim_at_start = (char *) sbrk (0); ^ /usr/include/unistd.h:585:1: note: 'sbrk' has been explicitly marked deprecated here __deprecated __WATCHOS_PROHIBITED __TVOS_PROHIBITED ^ /usr/include/sys/cdefs.h:176:37: note: expanded from macro '__deprecated' #define __deprecated __attribute__((deprecated)) ^ sbrk on macOS is not useful for our purposes, since sbrk(0) always returns the same value. From what I read, brk/sbrk on macOS is just an emulation, it always returns a pointer in a 4MB section reserved for that. So instead of letting users use "maint set per-command space on" and print silly results, I think we should just disable that feature for this platform (as we do for platforms that don't have sbrk). I defined a HAVE_USEFUL_SBRK macro and used that instead of HAVE_SBRK. gdb/ChangeLog: * common/common-defs.h (HAVE_USEFUL_SBRK): Define. * main.c: Use HAVE_USEFUL_SBRK instead of HAVE_SBRK. * maint.c: Likewise. * top.c: Likewise.
2018-07-04Update NEWS post GDB 8.2 branch creation.Joel Brobecker2-1/+9
gdb/ChangeLog: * NEWS: Create a new section for the next release branch. Rename the section of the current branch, now that it has been cut.
2018-07-04Bump version to 8.2.50.DATE-git.Joel Brobecker2-1/+6
Now that the GDB 8.2 branch has been created, we can bump the version number. gdb/ChangeLog: GDB 8.2 branch created (1b919490e8ba30bf1d6941df0ed112b0e557017e): * version.in: Bump version to 8.2.50.DATE-git.
2018-07-04Warn if /proc is not accessiblegdb-8.2-branchpointVyacheslav Barinov6-5/+45
There's a buildroot where I want to debug a binary, and I tried to connect to it from outside, but got very weird errors like architecture mismatch or protocol errors. At last, after switching on '--debug' for gdbserver I found a message 'Can't open /proc/pid/' message and suddenly found that I forgot to mount procfs in my buildroot. Make discovering the problem easier by making GDB / GDBserver warn (even without --debug) if /proc can not be accessed. Native debugging: (gdb) start Temporary breakpoint 1 at 0x400835: file test.c, line 10. Starting program: /tmp/test warning: /proc is not accessible. GDBserver/remote debugging: $ ./gdbserver :9999 ./gdbserver gdbserver: /proc is not accessible. gdb/ChangeLog: 2018-07-04 Vyacheslav Barinov <v.barinov@samsung.com> Pedro Alves <palves@redhat.com> * linux-nat.c (linux_init_ptrace): Rename to ... (linux_init_ptrace_procfs): ... this. Call linux_proc_init_warnings. (linux_nat_target::post_attach) (linux_nat_target::post_startup_inferior): Adjust. * nat/linux-procfs.c (linux_proc_init_warnings): Define function. * nat/linux-procfs.h (linux_proc_init_warnings): Declare function. gdb/gdbserver/ChangeLog: 2018-07-04 Vyacheslav Barinov <v.barinov@samsung.com> Pedro Alves <palves@redhat.com> * linux-low.c (initialize_low): Call linux_proc_init_warnings.
2018-07-04ld: Set non_ir_ref_regular for --undefined SYMBOLH.J. Lu6-7/+26
Set non_ir_ref_regular to TRUE for symbols forced into the output file so that they won't be removed by garbage collection with LTO. PR ld/23309 * ldlang.c (insert_undefined): Set non_ir_ref_regular to TRUE. * plugin.c (is_visible_from_outside): Don't scan entry_symbol. * testsuite/ld-plugin/pr23309.c: New file. * testsuite/ld-plugin/pr23309.d: Likewise.
2018-07-04ld: Properly display default for -z separate-codeH.J. Lu2-0/+13
Check DEFAULT_LD_Z_SEPARATE_CODE to display default for -z separate-code. PR ld/23358 * lexsup.c (elf_shlib_list_options): Properly display default for -z separate-code.
2018-07-04Also install diagnostics.hH.J. Lu3-3/+11
Since bfd.h is an installed header, also install diagnostics.h. * Makefile.am (bfdinclude_HEADERS): Add $(INCDIR)/diagnostics.h. * Makefile.in: Regenerated.
2018-07-04[gdb/symtab] Fix version check in dwarf compilation unit headerTom de Vries4-6/+15
The version check of the dwarf compilation unit header in error_check_comp_unit_head is done too late, and consequently dwarf code with an unsupported version in the compilation unit header is interpreted as dwarf5 code in read_comp_unit_head. Fixed by moving the check earlier. Build and reg-tested on x86_64-linux. 2018-07-04 Tom de Vries <tdevries@suse.de> * dwarf2read.c (error_check_comp_unit_head): Move dwarf version check ... (read_comp_unit_head): ... here. * gdb.dwarf2/dw2-error.exp: Update expected error message.
2018-07-03Remove VEC from breakpointTom Tromey4-75/+44
This removes a use of VEC from breakpoint.h, also removing the now-unnecessary breakpoint_p typedef. This patch fixes a latent memory leak in find_matching_tracepoint_location, which neglected to free the vector returned by all_tracepoints. Tested by the buildbot. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * tracepoint.c (process_tracepoint_on_disconnect, start_tracing) (stop_tracing, tstatus_command) (find_matching_tracepoint_location, merge_uploaded_tracepoints) (print_one_static_tracepoint_marker): Update. * breakpoint.c (static_tracepoints_here, all_tracepoints): Return std::vector. * breakpoint.h (breakpoint_p): Remove typedef. Don't declare VEC. (all_tracepoints, static_tracepoints_here): Return std::vector.
2018-07-04Automatic date update in version.inGDB Administrator1-1/+1
2018-07-03Remove ptid_equalTom Tromey49-194/+233
Remove ptid_equal in favor of using "==". gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_equal): Remove. * common/ptid.h (ptid_equal): Don't declare. * ada-tasks.c: Update. * breakpoint.c: Update. * common/agent.c: Update. * corelow.c: Update. * darwin-nat-info.c: Update. * darwin-nat.c: Update. * dcache.c: Update. * dtrace-probe.c: Update. * dummy-frame.c: Update. * fbsd-nat.c: Update. * frame.c: Update. * gdbthread.h: Update. * gnu-nat.c: Update. * go32-nat.c: Update. * inf-loop.c: Update. * inf-ptrace.c: Update. * infcall.c: Update. * infcmd.c: Update. * inflow.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-thread-db.c: Update. * mi/mi-cmd-var.c: Update. * mi/mi-interp.c: Update. * mi/mi-main.c: Update. * nto-procfs.c: Update. * ppc-linux-tdep.c: Update. * procfs.c: Update. * python/py-inferior.c: Update. * python/py-record-btrace.c: Update. * python/py-record.c: Update. * ravenscar-thread.c: Update. * regcache.c: Update. * remote-sim.c: Update. * remote.c: Update. * sol-thread.c: Update. * solib.c: Update. * target.c: Update. * tui/tui-stack.c: Update. * varobj.c: Update. * windows-nat.c: Update. * windows-tdep.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * lynx-low.c: Update. * mem-break.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * win32-low.c: Update.
2018-07-03Remove ptid_matchTom Tromey12-36/+40
This removes ptid_match in favor of the ptid_t::matches method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_match): Remove. * common/ptid.h (ptid_match): Don't declare. * fbsd-nat.c: Update. * infcmd.c: Update. * infrun.c: Update. * linux-nat.c: Update. * record-btrace.c: Update. * regcache.c: Update. * remote.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * server.c: Update.
2018-07-03Remove ptid_tid_pTom Tromey4-20/+14
This removes ptid_tid_p in favor of the ptid_t::tid_p method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_tid_p): Remove. * common/ptid.h (ptid_tid_p): Don't declare. * sol-thread.c: Update.
2018-07-03Remove ptid_lwp_pTom Tromey8-22/+20
This removes ptid_lwp_p in favor of the ptid_t::lwp_p method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_lwp_p): Remove. * common/ptid.h (ptid_lwp_p): Don't declare. * fbsd-nat.c: Update. * linux-nat.c: Update. * nat/linux-procfs.c: Update. * nat/x86-linux-dregs.c: Update. * sol-thread.c: Update.
2018-07-03Remove ptid_is_pidTom Tromey10-33/+35
This removes ptid_is_pid in favor of the ptid_t::is_pid method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_is_pid): Remove. * common/ptid.h (ptid_is_pid): Don't declare. * infrun.c: Update. * linux-nat.c: Update. * mi/mi-interp.c: Update. * remote.c: Update. * thread.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update.
2018-07-03Remove ptid_get_tidTom Tromey20-79/+91
This removes ptid_get_tid in favor of calling the ptid_t::tid method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_get_tid): Remove. * common/ptid.h (ptid_get_tid): Don't declare. * ada-tasks.c: Update. * aix-thread.c: Update. * bsd-uthread.c: Update. * darwin-nat.c: Update. * fbsd-nat.c: Update. * i386-darwin-nat.c: Update. * infrun.c: Update. * linux-tdep.c: Update. * nto-procfs.c: Update. * ppc-ravenscar-thread.c: Update. * python/py-infthread.c: Update. * ravenscar-thread.c: Update. * sol-thread.c: Update. * sparc-ravenscar-thread.c: Update. * windows-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * target.c: Update.
2018-07-03Remove ptid_get_lwpTom Tromey52-219/+263
This removes ptid_get_lwp in favor of calling the ptid_t::lwp method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_get_lwp): Remove. * common/ptid.h (ptid_get_lwp): Don't declare. * aarch64-linux-nat.c: Update. * ada-tasks.c: Update. * aix-thread.c: Update. * amd64-linux-nat.c: Update. * arm-linux-nat.c: Update. * corelow.c: Update. * fbsd-nat.c: Update. * fbsd-tdep.c: Update. * gnu-nat.c: Update. * i386-cygwin-tdep.c: Update. * i386-gnu-nat.c: Update. * i386-linux-nat.c: Update. * ia64-linux-nat.c: Update. * inf-ptrace.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * mips-linux-nat.c: Update. * nat/aarch64-linux-hw-point.c: Update. * nat/aarch64-linux.c: Update. * nat/linux-btrace.c: Update. * nat/linux-osdata.c: Update. * nat/linux-procfs.c: Update. * nat/x86-linux-dregs.c: Update. * obsd-nat.c: Update. * ppc-fbsd-nat.c: Update. * ppc-linux-nat.c: Update. * procfs.c: Update. * python/py-infthread.c: Update. * ravenscar-thread.c: Update. * remote.c: Update. * s390-linux-nat.c: Update. * sol-thread.c: Update. * sol2-tdep.c: Update. * spu-linux-nat.c: Update. * x86-linux-nat.c: Update. * xtensa-linux-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * linux-mips-low.c: Update. * lynx-low.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * thread-db.c: Update.
2018-07-03Remove ptid_get_pidTom Tromey85-437/+518
This removes ptid_get_pid in favor of calling the ptid_t::pid method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_get_pid): Remove. * common/ptid.h (ptid_get_pid): Don't declare. * aarch64-linux-nat.c: Update. * ada-lang.c: Update. * aix-thread.c: Update. * alpha-bsd-nat.c: Update. * amd64-fbsd-nat.c: Update. * amd64-linux-nat.c: Update. * arm-linux-nat.c: Update. * arm-nbsd-nat.c: Update. * auxv.c: Update. * break-catch-syscall.c: Update. * breakpoint.c: Update. * bsd-uthread.c: Update. * corelow.c: Update. * ctf.c: Update. * darwin-nat.c: Update. * fbsd-nat.c: Update. * fbsd-tdep.c: Update. * gcore.c: Update. * gnu-nat.c: Update. * hppa-nbsd-nat.c: Update. * hppa-obsd-nat.c: Update. * i386-fbsd-nat.c: Update. * ia64-linux-nat.c: Update. * inf-ptrace.c: Update. * infcmd.c: Update. * inferior.c: Update. * inferior.h: Update. * inflow.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * m68k-bsd-nat.c: Update. * mi/mi-interp.c: Update. * mi/mi-main.c: Update. * mips-linux-nat.c: Update. * mips-nbsd-nat.c: Update. * mips64-obsd-nat.c: Update. * nat/aarch64-linux-hw-point.c: Update. * nat/aarch64-linux.c: Update. * nat/linux-btrace.c: Update. * nat/linux-osdata.c: Update. * nat/linux-procfs.c: Update. * nat/x86-linux-dregs.c: Update. * nto-procfs.c: Update. * obsd-nat.c: Update. * ppc-linux-nat.c: Update. * ppc-nbsd-nat.c: Update. * ppc-obsd-nat.c: Update. * proc-service.c: Update. * procfs.c: Update. * python/py-inferior.c: Update. * python/py-infthread.c: Update. * ravenscar-thread.c: Update. * record.c: Update. * remote-sim.c: Update. * remote.c: Update. * rs6000-nat.c: Update. * s390-linux-nat.c: Update. * sh-nbsd-nat.c: Update. * sol-thread.c: Update. * sparc-nat.c: Update. * sparc64-tdep.c: Update. * spu-linux-nat.c: Update. * spu-tdep.c: Update. * target-debug.h: Update. * target.c: Update. * thread.c: Update. * tid-parse.c: Update. * tracefile-tfile.c: Update. * vax-bsd-nat.c: Update. * windows-nat.c: Update. * x86-linux-nat.c: Update. * x86-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * linux-mips-low.c: Update. * lynx-low.c: Update. * mem-break.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * tracepoint.c: Update.
2018-07-03Remove pid_to_ptidTom Tromey43-139/+176
This removes pid_to_ptid in favor of calling the ptid_t constructor directly. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (pid_to_ptid): Remove. * common/ptid.h (pid_to_ptid): Don't declare. * aix-thread.c: Update. * arm-linux-nat.c: Update. * common/ptid.c: Update. * common/ptid.h: Update. * corelow.c: Update. * ctf.c: Update. * darwin-nat.c: Update. * fbsd-nat.c: Update. * fork-child.c: Update. * gnu-nat.c: Update. * go32-nat.c: Update. * inf-ptrace.c: Update. * infcmd.c: Update. * inferior.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * nat/aarch64-linux-hw-point.c: Update. * nat/fork-inferior.c: Update. * nat/x86-linux-dregs.c: Update. * nto-procfs.c: Update. * obsd-nat.c: Update. * procfs.c: Update. * progspace.c: Update. * remote.c: Update. * rs6000-nat.c: Update. * s390-linux-nat.c: Update. * sol-thread.c: Update. * spu-linux-nat.c: Update. * target.c: Update. * top.c: Update. * tracefile-tfile.c: Update. * windows-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * linux-ppc-low.c: Update. * linux-x86-low.c: Update. * proc-service.c: Update. * server.c: Update. * spu-low.c: Update. * thread-db.c: Update. * win32-low.c: Update.
2018-07-03Remove ptid_buildTom Tromey33-130/+157
This removes ptid_build in favor of simply calling the ptid_t constructor directly. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.h (ptid_build): Don't declare. * common/ptid.c (ptid_build): Remove. * aix-thread.c: Update. * bsd-kvm.c: Update. * bsd-uthread.c: Update. * common/agent.c: Update. * common/ptid.c: Update. * common/ptid.h: Update. * corelow.c: Update. * darwin-nat.c: Update. * fbsd-nat.c: Update. * gnu-nat.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-thread-db.c: Update. * nat/linux-osdata.c: Update. * nat/linux-procfs.c: Update. * nto-procfs.c: Update. * obsd-nat.c: Update. * proc-service.c: Update. * procfs.c: Update. * ravenscar-thread.c: Update. * remote-sim.c: Update. * remote.c: Update. * sol-thread.c: Update. * target.c: Update. * windows-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * lynx-low.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * spu-low.c: Update. * thread-db.c: Update. * win32-low.c: Update.
2018-07-03Remove exit_inferior_num_silentTom Tromey3-9/+7
The sole caller of exit_inferior_num_silent was getting the inferior's number to then use the number to look up the inferior again. I think it's better to simply not have exit_inferior_num_silent; any potential callers that only have the inferior's number should probably be converted to pass the inferior itself around instead. Tested by the buildbot. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * infrun.c (follow_exec): Use exit_inferior_silent. * inferior.c (exit_inferior_num_silent): Remove. * inferior.h (exit_inferior_num_silent): Don't declare.
2018-07-03Fix crash in "run" on macOS when gdb is not signedTom Tromey2-52/+73
On macOS, when gdb is not code-signed, it will throw an exception from darwin_attach_pid. However, gdb also then crashes: thread.c:93: internal-error: struct thread_info *inferior_thread(): Assertion `tp' failed. I think the problem here is that darwin_attach_pid does not clean up inferior_ptid and inf->pid on failure. This leads to a situation where gdb tries to find a thread, but cannot. In other cases, gdb would mourn the inferior at this point; but here this is not possible because the target has not been pushed. Instead this patch works by simply updating the inferior and inferior_ptid on failure. Tested by building an unsigned gdb on macOS and trying to run an inferior. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> PR cli/23340: * darwin-nat.c (darwin_attach_pid): Reset inferior and inferior_ptid on error.
2018-07-03Correct removal of .gnu.attributesAlan Modra2-7/+16
Setting SEC_EXCLUDE for empty .gnu.attributes is too late in the link process for the linker to remove the section. That must be done in bfd_elf_final_link, as we do for removed group sections. * elflink.c (bfd_elf_final_link): Remove zero size .gnu.attributes sections.
2018-07-03GNU attribute output on errorsAlan Modra5-58/+109
.gnu.attributes entries from linker input files are merged to the output file, the output having the union of compatible input attributes. Incompatible attributes generally cause a linker error and no output. However in some cases only a warning is emitted, and one of the incompatible input attributes is passed on to the output. PowerPC tends to emit warnings rather than errors, and the output takes the first input attribute. For example, if we have two input files with Tag_GNU_Power_ABI_FP, the first with a value signifying "double-precision hard float, IBM long double", the second with a value signifying "double-precision hard float, IEEE long double", we'll get a warning about incompatible long double types and the output will say "double-precision hard float, IBM long double". The output attribute of course isn't correct. It would be correct to specify "IBM and IEEE long double", but we don't have a way to represent that currently. While it would be possible to extend the encoding, there isn't much gain in doing so. A shared library providing support for both long double types should link against objects using either long double type without warning or error. That is what you'd get if such a shared library had no Tag_GNU_Power_ABI_FP attribute. So this patch provides a way for the backend to omit .gnu.attributes tags from the output. * elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define. * elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR. * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use ATTR_TYPE_FLAG_INT_VAL. Set ATTR_TYPE_HAS_ERROR on finding incompatible attribute. (ppc_elf_merge_obj_attributes): Likewise. Return _bfd_elf_merge_object_attributes result. * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return _bfd_elf_merge_object_attributes result.
2018-07-03Hide dynamic symbols in discarded sectionsAlan Modra2-2/+12
This is a followup to git commit 97196564c7 "Strip global symbol defined in discarded section". If a symbol defined in a discarded section was dynamic, that patch left .dynsym with holes (ie. all zero entries). For example, the following from libstdc++.so: Symbol table '.dynsym' contains 6090 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000000a74e0 0 SECTION LOCAL DEFAULT 10 2: 0000000000264180 0 SECTION LOCAL DEFAULT 17 3: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_addUserCommitAction 4: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_memcpyRtWn 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND readelf: Warning: local symbol 5 found at index >= .dynsym's sh_info value of 3 6: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND readelf: Warning: local symbol 6 found at index >= .dynsym's sh_info value of 3 [snip] This patch removes the symbols from .dynsym too. PR 17550 * elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols in discarded sections.
2018-07-03Automatic date update in version.inGDB Administrator1-1/+1
2018-07-02MIPS/BFD: Make section GC work with `ict_irix5' targetsMaciej W. Rozycki2-0/+7
Prevent runtime procedure table symbols, produced with `ict_irix5' MIPS targets, from being swept in section GC, fixing linker errors like: ./ld-new: tmpdir/dump: protected symbol `_procedure_table_size' isn't defined ./ld-new: final link failed: bad value triggered whenever section GC is enabled with those targets and consequently removing the following test suite failures: FAIL: Build pr22649-2a.so FAIL: Build pr22649-2c.so FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library) FAIL: PR ld/20828 dynamic symbols with section GC (plain) FAIL: PR ld/20828 dynamic symbols with section GC (version script) FAIL: PR ld/20828 dynamic symbols with section GC (versioned shared library) FAIL: PR ld/20828 dynamic symbols with section GC (versioned) FAIL: --gc-sections with .text._init FAIL: pr20022 observed with `mips-elf', `tx39-elf', `mipsisa32-elf', `mipsisa64-elf', `mipsel-elf', `mipsisa32el-elf', `mipsisa64el-elf', `mips64vr-elf', `mips64vrel-elf', `mips64vr4300-elf', `mips64vr4300el-elf', `mips-sgi-irix5' and `mips-rtems' targets, among others. This fix makes section GC usable with the affected targets. bfd/ * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Set `mark' for symbols created from `mips_elf_dynsym_rtproc_names' list.
2018-07-02microMIPS/GAS: Handle several percent-ops with macrosMaciej W. Rozycki8-1/+692
In the microMIPS mode also accept %half, %got, %call, %got_hi, %got_lo, %call_hi, %call_lo, %neg, %got_page, %highest, %got_disp, %tlsgd, %tlsldm, %dtprel_hi, %dtprel_lo, %gottprel, %tprel_hi and %tprel_lo percent-ops with macros, so that they can be used with instructions that expand into sequences if relocation is required due to their limited offset span, such as LL, LWL, etc., fixing GAS assertions: .../gas/testsuite/gas/mips/elf-rel28.s: Assembler messages: .../gas/testsuite/gas/mips/elf-rel28.s:17: Internal error in macro_build at .../gas/config/tc-mips.c:8854. Please report this bug. observed if an attempt is made to assemble the `elf-rel28.s' test case modified to use one of the affected instructions to microMIPS code. gas/ * config/tc-mips.c (macro_build) <'i', 'j'>: Also accept BFD_RELOC_16, BFD_RELOC_MIPS_GOT16, BFD_RELOC_MIPS_CALL16, BFD_RELOC_MIPS_GOT_HI16, BFD_RELOC_MIPS_GOT_LO16, BFD_RELOC_MIPS_CALL_HI16, BFD_RELOC_MIPS_CALL_LO16, BFD_RELOC_MIPS_SUB, BFD_RELOC_MIPS_GOT_PAGE, BFD_RELOC_MIPS_HIGHEST, BFD_RELOC_MIPS_GOT_DISP, BFD_RELOC_MIPS_TLS_GD, BFD_RELOC_MIPS_TLS_LDM, BFD_RELOC_MIPS_TLS_DTPREL_HI16, BFD_RELOC_MIPS_TLS_DTPREL_LO16, BFD_RELOC_MIPS_TLS_GOTTPREL, BFD_RELOC_MIPS_TLS_TPREL_HI16 and BFD_RELOC_MIPS_TLS_TPREL_LO16 relocations if in the microMIPS mode. * testsuite/gas/mips/elf-rel28-lldscd-n32.d: New test. * testsuite/gas/mips/elf-rel28-lldscd-micromips-n32.d: New test. * testsuite/gas/mips/elf-rel28-lldscd-n64.d: New test. * testsuite/gas/mips/elf-rel28-lldscd-micromips-n64.d: New test. * testsuite/gas/mips/elf-rel28.s: Add instruction selection. * testsuite/gas/mips/mips.exp: Run the new tests.
2018-07-02microMIPS/BFD: Add missing NewABI TLS and miscellaneous relocationsMaciej W. Rozycki7-0/+968
Complement commit df58fc944dbc ("MIPS: microMIPS ASE support"), <https://sourceware.org/ml/binutils/2011-07/msg00198.html>, and add TLS and a few miscellaneous relocations to NewABI microMIPS support, fixing GAS assertion failures: .../gas/testsuite/gas/mips/elf-rel28.s: Assembler messages: .../gas/testsuite/gas/mips/elf-rel28.s:19: Internal error in append_insn at .../gas/config/tc-mips.c:7660. Please report this bug. observed if an attempt is made to assemble the `elf-rel28.s' test case to microMIPS code. The relocations are the same as with o32 support, except for `partial_inplace' and `src_mask' updates for the respective RELA variants. bfd/ * elf64-mips.c (micromips_elf64_howto_table_rel): Add R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM, R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16, R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16, R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and R_MICROMIPS_PC23_S2 relocation entries. (micromips_elf64_howto_table_rela): Likewise. (micromips_reloc_map): Likewise. * elfn32-mips.c (elf_micromips_howto_table_rel): Likewise. (elf_micromips_howto_table_rela): Likewise. (micromips_reloc_map): Likewise. gas/ * testsuite/gas/mips/elf-rel28-micromips-n32.d: New test. * testsuite/gas/mips/elf-rel28-micromips-n64.d: New test. * testsuite/gas/mips/mips.exp: Run the new tests.
2018-07-02MIPS/LD/testsuite: Fix a typo in PR ld/21334 test nameMaciej W. Rozycki2-1/+6
ld/ * testsuite/ld-mips-elf/mips-elf.exp: Fix a typo in PR ld/21334 test name.