aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-06-12testsuite/ld-cris/libdso-1.d: Correct recent address pattern update.Hans-Peter Nilsson2-1/+7
2018-06-12Fix the PR22983 test so that it will work regardless of the order of the ↵Nick Clifton6-2/+49
symbols in the dynamic symbol table. See email thread starting here for more details: https://sourceware.org/ml/binutils/2018-06/msg00036.html PR 22983 * testsuite/ld-plugin/lto.exp: Use individual tests to check for the presence of each expected symbol. * testsuite/ld-plugin/pr22983.1.d: New file. * testsuite/ld-plugin/pr22983.2.d: New file. * testsuite/ld-plugin/pr22983.3.d: New file. * testsuite/ld-plugin/pr22983.4.d: New file.
2018-06-12Fix syntax error in AArch64 default linker scripts when invoked with -shared.Nick Clifton2-1/+6
* emulparams/aarch64elf.sh (OTHER_BSS_END_SYMBOLS): Make the definition of the __bss_end__ symbol conditional upon CREATE_SHLIB.
2018-06-11Rename some functions, index -> gdb_indexSimon Marchi2-22/+29
Since we now have two index formats, DWARF5/debug_names and gdb_index, I wanted to rename some functions to make it clear that they deal with the gdb_index format specifically. gdb/ChangeLog: * dwarf2read.c (read_index_from_section): Rename to... (read_gdb_index_from_section): ... this, update all callers. (dwarf2_read_index): Rename to... (dwarf2_read_gdb_index): ... this, update all callers.
2018-06-11Fix gdb build on hppa-linuxJohn David Anglin2-2/+7
Fixes: CXX hppa-linux-nat.o ../../src/gdb/hppa-linux-nat.c:277:17: error: no 'void hppa_linux_nat_target::fetch_inferior_registers(regcache*, int)' member function declared in class 'hppa_linux_nat_target' int regno) ^ ../../src/gdb/hppa-linux-nat.c:224:1: error: 'void fetch_register(regcache*, int)' defined but not used [-Werror=unused-function] fetch_register (struct regcache *regcache, int regno) ^~~~~~~~~~~~~~ gdb/ChangeLog: * gdb/hppa-linux-nat.c (hppa_linux_nat_target::fetch_inferior_registers): Rename to hppa_linux_nat_target::fetch_registers.
2018-06-12Automatic date update in version.inGDB Administrator1-1/+1
2018-06-11Fix build of GDB documentation.Eli Zaretskii2-0/+5
gdb/doc/ChangeLog 2018-06-11 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Maintenance Commands): Add a missing @anchor.
2018-06-11MIPS/GAS: Correct `-O0' and `-O' option help, add `-O1' and `-O2'Maciej W. Rozycki2-2/+8
Match commit 4ffff32f75b1 ("Match mips_optimize to the -O option supplied") and adjust `--help' output for `-O0', `-O', `-O1' and `-O2' options. gas/ * config/tc-mips.c (md_show_usage): Correct help text for `-O0' and `-O'. Mention `-O1'. Add `-O2' and its description.
2018-06-11Enable Aarch64 SVE for gdbserverAlan Hayward6-14/+44
gdbserver/ * linux-aarch64-ipa.c (get_ipa_tdesc): Add null VQ param. (initialize_low_tracepoint): Likewise * linux-aarch64-low.c (aarch64_arch_setup): Get VQ. * linux-aarch64-tdesc-selftest.c (aarch64_tdesc_test): Add null VQ param. * linux-aarch64-tdesc.c (aarch64_linux_read_description): Add VQ checks. * linux-aarch64-tdesc.h (aarch64_linux_read_description): Add VQ.
2018-06-11Updated Spanish translations for the binutils/ and ld/ subdirectories.Nick Clifton4-2069/+2965
* po/es.po: Updated Spanish translation.
2018-06-11Increase gdbsever PBUFSIZAlan Hayward2-1/+5
PBUFSIZ is no longer big enough for SVE. Increase accordingly. gdbserver/ * server.h (PBUFSIZ): Increase size
2018-06-11Add Aarch64 SVE dwarf regnumsAlan Hayward3-1/+24
This is as per the spec: https://developer.arm.com/products/architecture/a-profile/docs/100985/0000 gdb/ * aarch64-tdep.c (aarch64_dwarf_reg_to_regnum): Add mappings. * aarch64-tdep.h (AARCH64_DWARF_SVE_VG): Add define. (AARCH64_DWARF_SVE_FFR): Likewise. (AARCH64_DWARF_SVE_P0): Likewise. (AARCH64_DWARF_SVE_Z0): Likewise.
2018-06-11Add regcache raw_compare methodAlan Hayward7-0/+50
gdb/ * common/common-regcache.h (raw_compare): New function. * regcache.c (regcache::raw_compare): Likewise. * regcache.h (regcache::raw_compare): New declaration. gdbserver/ * regcache.c (regcache::raw_compare): New function. * regcache.h (regcache::raw_compare): New declaration.
2018-06-11Add reg_buffer_commonAlan Hayward7-73/+155
A purely virtual class containing functions from gdb/regcache.h Both the gdb regcache structures and gdbserver regcache inherit directly from reg_buffer_common. This will allow for common functions which require the use of a regcache. gdb/ * common/common-regcache.h (reg_buffer_common): New structure. * regcache.c (reg_buffer::invalidate): Move from detached_regcache. (reg_buffer::raw_supply): Likewise. (reg_buffer::raw_supply_integer): Likewise. (reg_buffer::raw_supply_zeroed): Likewise. (reg_buffer::raw_collect): Likewise. (reg_buffer::raw_collect_integer): Likewise. * regcache.h (reg_buffer::invalidate): Move from detached_regcache. (reg_buffer::raw_supply): Likewise. (reg_buffer::raw_supply_integer): Likewise. (reg_buffer::raw_supply_zeroed): Likewise. (reg_buffer::raw_collect): Likewise. (reg_buffer::raw_collect_integer): Likewise. gdbserver/ * regcache.c (new_register_cache): Use new. (free_register_cache): Use delete. (register_data): Use const. (supply_register): Move body inside regcache. (regcache::raw_supply): New override function. (collect_register): Move body inside regcache. (regcache::raw_collect): New override function. (regcache::get_register_status): New override function. * regcache.h (struct regcache): Inherit from reg_buffer_common.
2018-06-10Remove use of queue from remote.cTom Tromey2-228/+108
This removes a use of the queue data structure (common/queue.h) from remote.c. The queue is replaced with a std::vector. A queue was not needed, as the code never de-queued items. This removes quite a bit of boilerplate code, mostly involved with marshalling arguments to be passed through the queue iterator. Tested by the buildbot. gdb/ChangeLog 2018-06-10 Tom Tromey <tom@tromey.com> * remote.c (stop_reply_p): Remove typedef. Don't declare queue. (class remote_state) <stop_reply_queue>: Now std::vector. (remote_state::~remote_state) (remote_target::stop_reply_queue_length): Update. (struct queue_iter_param, remove_child_of_pending_fork) (struct check_pending_event_prevents_wildcard_vcont_callback_data) (check_pending_event_prevents_wildcard_vcont_callback) (remove_stop_reply_for_inferior) (remove_stop_reply_of_remote_state) (remote_notif_remove_once_on_match) (stop_reply_match_ptid_and_ws) (remote_kill_child_of_pending_fork): Remove. (remote_target::remove_new_fork_children) (remote_target::check_pending_events_prevent_wildcard_vcont) (remote_target::discard_pending_stop_replies) (remote_target::discard_pending_stop_replies_in_queue) (remote_target::remote_notif_remove_queued_reply) (remote_target::queued_stop_reply) (remote_target::push_stop_reply, remote_target::peek_stop_reply) (remote_target::wait, remote_target::kill_new_fork_children) (remote_target::async): Update.
2018-06-10Remove cleanups from record-full.cTom Tromey2-269/+290
This removes cleanups from record-full.c. In this case, the cleanups were only ever run when an exception was thrown. So, I replaced these with try/catch, rather than introduce a new specialized RAII type. Tested by the buildbot. gdb/ChangeLog 2018-06-10 Tom Tromey <tom@tromey.com> * record-full.c (record_full_arch_list_cleanups): Remove. (record_full_message): Use try/catch. (record_full_wait_cleanups): Remove. (record_full_wait_1): Use try/catch. (record_full_restore): Likewise.
2018-06-10Remove a VEC from record-full.cTom Tromey2-44/+45
This replaces a VEC in record-full.c with a std::vector. This version of the patch also catches a memory leak in the original code noticed by Simon. Tested by the buildbot. gdb/ChangeLog 2018-06-10 Tom Tromey <tom@tromey.com> * record-full.c (record_full_breakpoint_p): Remove typedef. Don't declare VEC. Add constructor. <in_target_beneath>: Now bool. (record_full_breakpoints): Now a std::vector, static. (record_full_sync_record_breakpoints) (record_full_init_record_breakpoints) (record_full_target::insert_breakpoint) (record_full_target::remove_breakpoint): Update. Don't use XNEW.
2018-06-10Remove more "struct" keywords in range-based for loopsSimon Marchi3-2/+7
GCC 6.3.0 produces this kind of errors: CXX dwarf2read.o /home/simark/src/binutils-gdb/gdb/dwarf2read.c: In function 'void process_cu_includes(dwarf2_per_objfile*)': /home/simark/src/binutils-gdb/gdb/dwarf2read.c:10220:8: error: types may not be defined in a for-range-declaration [-Werror] for (struct dwarf2_per_cu_data *iter : dwarf2_per_objfile->just_read_cus) ^~~~~~ Removing the struct keyword makes it happy. gdb/ChangeLog: * dwarf2read.c (process_cu_includes): Remove struct keyword. * serial.c (serial_interface_lookup): Remove struct keyword.
2018-06-11Automatic date update in version.inGDB Administrator1-1/+1
2018-06-10Fix some missed "beneath" conversionsTom Tromey6-12/+25
The buildbot pointed out that arm-linux-nat.c was not properly using "beneath" as a method. A search showed a few more places with this issue. Tested by the buildbot, though of course this only checked arm-linux-nat.c. Nevertheless I'm checking this in under the obvious rule. gdb/ChangeLog 2018-06-10 Tom Tromey <tom@tromey.com> * procfs.c (procfs_target::xfer_partial): Use "beneath" as a method. * nto-procfs.c (nto_procfs_target::xfer_partial): Use "beneath" as a method. * go32-nat.c (go32_nat_target::xfer_partial): Use "beneath" as a method. * arm-linux-nat.c (arm_linux_nat_target::read_description): Use "beneath" as a method. * arm-fbsd-nat.c (arm_fbsd_nat_target::read_description): Use "beneath" as a method.
2018-06-10Remove cleanups from tracefile.cTom Tromey2-32/+25
This removes cleanups from tracefile.c, by introducing a unique_ptr specialization. This code could be made even simpler via a deeper C++-ification, but I have not attempted that. Tested by the buildbot. gdb/ChangeLog 2018-06-10 Tom Tromey <tom@tromey.com> * tracefile.c (struct trace_file_writer_deleter): New. <operator()>: Rename from trace_file_writer_xfree. (trace_file_writer_up): New typedef. (tsave_command, trace_save_tfile, trace_save_ctf): Update.
2018-06-09Use std::unique_ptr in reg_bufferSimon Marchi3-16/+21
Using std::unique_ptr allows to remove the manual xfree in the destructor. If I understand correctly, using the () after the new operator will make sure the allocated objects will be value initialized, which for scalars means they are zero-initialized. So it should have the same behavior as XCNEWVEC. gdb/ChangeLog: * regcache.h (reg_buffer) <~reg_buffer>: Use default destructor. <m_registers, m_register_status>: Change type to std::unique_ptr. * regcache.c (reg_buffer::reg_buffer): Use new instead of XCNEWVEC.
2018-06-09Change type of reg_buffer::m_register_status to register_statusSimon Marchi4-9/+23
The type of reg_buffer::m_register_status is an array of signed char, probably to ensure that each element takes up only one byte. Instead, since we use C++11, we can force the underlying type of register_status to be signed char and use the enum type. gdb/ChangeLog: * common/common-regcache.h (enum register_status): Add underlying type "signed char". * regcache.h (reg_buffer) <m_register_status>: Change type to register_status *. * regcache.c (reg_buffer::reg_buffer): Alocate arrays of register_status instead of signed char. (reg_buffer::save): Use REG_UNKNOWN instead of 0. (reg_buffer::get_register_status): Remove cast. (readable_regcache::raw_read): Remove cast. (readable_regcache::cooked_read): Remove cast.
2018-06-10Automatic date update in version.inGDB Administrator1-1/+1
2018-06-09Remove use of queue.h from gdbserver/event-loop.cTom Tromey2-22/+20
This removes a use of queue.h from gdbserver/event-loop.c, replacing it with std::queue. I was not completely sure whether std::queue is even that useful. Perhaps plain std::list could be used just as easily. Tested by the buildbot. gdb/gdbserver/ChangeLog 2018-06-09 Tom Tromey <tom@tromey.com> * event-loop.c (gdb_event, gdb_event_p): Remove typedefs. Don't declare queue. (event_queue): Use std::queue. (gdb_event_xfree): Remove. (initialize_event_loop, process_event, wait_for_event): Update.
2018-06-09Remove two more uses of make_cleanup_closeTom Tromey2-18/+17
This removes two more uses of make_cleanup_close, replacing them with relatively straightforward uses of scoped_fd. Tested by the buildbot. gdb/ChangeLog 2018-06-09 Tom Tromey <tom@tromey.com> * source.c (reverse_search_command, forward_search_command): Use scoped_fd.
2018-06-09Remove a VEC from serial.cTom Tromey2-9/+9
This replaces a VEC in serial.c with a std::vector. Tested by the buildbot. gdb/ChangeLog 2018-06-09 Tom Tromey <tom@tromey.com> * serial.c (serial_ops_p): Remove typedef. Don't declare VEC. (serial_ops_list): Now static, std::vector. (serial_interface_lookup, serial_add_interface): Update.
2018-06-09Remove a VEC from dwarf2read.cTom Tromey3-10/+11
This removes a VEC from dwarf2read.c, replacing it with a std::vector. Tested by the buildbot. gdb/ChangeLog 2018-06-09 Tom Tromey <tom@tromey.com> * dwarf2read.c (process_cu_includes): Update. (process_full_comp_unit): Update. * dwarf2read.h (struct dwarf2_per_objfile) <just_read_cus>: Now a std::vector.
2018-06-09MIPS/LD/testsuite: Add microMIPS lazy binding stub testsMaciej W. Rozycki12-22/+217
Adapt the existing regular MIPS lazy binding stub tests for microMIPS code verification. Check both regular and `--insn32' variants. Correct indentation issues in the conditional updated. ld/ * testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d: New test. * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests. Fix indentation.
2018-06-09MIPS/LD/testsuite: Fix lazy binding stub test symbol count commentMaciej W. Rozycki2-1/+6
Update the symbol count in the comment associated with lazy binding stub tests to match `base_syms', complementing commit 889acb80acd5 ("MIPS/Linux/LD/testsuite: Linker script _gp scope updates"), <https://sourceware.org/ml/binutils/2012-08/msg00066.html>, and commit 2f9efdfcdbf1 ("mips/bfd/ld: Fix --as-needed on mips and update related ld tests"), <https://sourceware.org/ml/binutils/2013-09/msg00131.html>. ld/ * testsuite/ld-mips-elf/mips-elf.exp: Update symbol count in the comment associated with lazy binding stub tests.
2018-06-09MIPS/LD: Add missing `mips-*-windiss' target emulation dependencyMaciej W. Rozycki3-2/+7
As from commit 2ebd05b80b22 ("MIPS/LD: Correct `mips-*-windiss' target emulation configuration") we have: EXTRA_EM_FILE=mipself in `emulparams/elf32mipswindiss.sh', however no corresponding Makefile `mipself.em' dependency for `eelf32mipswindiss.c'. Add it. ld/ * Makefile.am (eelf32mipswindiss.c): Add `mipself.em' dependency. * Makefile.in: Regenerate.
2018-06-09Automatic date update in version.inGDB Administrator1-1/+1
2018-06-08Add missing client_state struct references to win target.Stan Cox2-1/+7
gdbserver/ChangeLog * win32-low.c (win32_create_inferior): last_ptid and last_status moved to client_state.
2018-06-08Make gdbreplay use more common routinesPedro Alves3-37/+52
This makes gdbreplay share a bit more code with gdbserver, and paves the way to share more in future. Including common-defs.h pulls in defines and headers that gdb and gdbserver assume are always defined/available too, such as for example _(), ansidecl.h or a set of system headers. Including that revealed (static vs extern conflict) gdbreplay had a local copy of perror_with_name (which exited directly instead of throwing an error). So I removed gdbreplay's local copy, and then added enough .o files until gdbreplay linked successfully. Also, use xstrdup instead of strdup. gdb/gdbserver/ChangeLog: 2018-06-08 Pedro Alves <palves@redhat.com> * Makefile.in (GDBREPLAY_OBS): Add common/cleanups.o, common/common-exceptions.o, common/common-utils.o, common/errors.o, common/print-utils.o and utils.o. * gdbreplay.c: Include "common-defs.h" instead of the two 'config.h's here. Don't include stdio.h, errno.h, stdlib.h, string.h or alloca.h. (perror_with_name): Delete. (remote_open): Use xstrdup instead of strdup. (main): Rename to ... (captured_main): ... this. (main): New.
2018-06-08ld/x86: Remove hidden _edata, __bss_start, and _endH.J. Lu4-7/+43
There is no need to put hidden _edata, __bss_start, and _end in dynamic symbol table in shared libraries. bfd/ PR ld/23161 * elfxx-x86.c (elf_x86_hide_linker_defined): New function. (_bfd_x86_elf_link_check_relocs): Use it to hide hidden __bss_start, _end and _edata in shared libraries. ld/ PR ld/23161 * testsuite/ld-elf/pr23161d.rd: Remove local _edata, __bss_start, and _end from dynamic symbol table.
2018-06-08Fix build issue with Python 3.7Paul Koning2-3/+23
Originally reported in https://bugzilla.redhat.com/show_bug.cgi?id=1577396 -- gdb build fails with Python 3.7 due to references to a Python internal function whose declaration changed in 3.7. gdb/ChangeLog 2018-06-08 Paul Koning <paul_koning@dell.com> PR gdb/23252 * python/python.c (do_start_initialization): Avoid call to internal Python API. (init__gdb_module): New function.
2018-06-08linux: Add maintenance commands to test libthread_dbGary Benson8-0/+524
This commit adds two new commands which may be used to test thread debugging libraries used by GDB: * "maint check libthread-db" tests the thread debugging library GDB is using for the current inferior. * "maint set/show check-libthread-db" selects whether libthread_db tests should be run automatically as libthread_db is auto-loaded. The default is to not run tests automatically. The test itself is a basic integrity check exercising all libthread_db functions used by GDB on GNU/Linux systems. By extension this also exercises the proc_service functions provided by GDB that libthread_db uses. This functionality is useful for NPTL developers and libthread_db developers. It could also prove useful investigating bugs reported against GDB where the thread debugging library or GDB's proc_service layer is suspect. gdb/ChangeLog: * linux-thread-db.c (valprint.h): New include. (struct check_thread_db_info): New structure. (check_thread_db_on_load, tdb_testinfo): New static globals. (check_thread_db, check_thread_db_callback): New functions. (try_thread_db_load_1): Run integrity checks if requested. (maintenance_check_libthread_db): New function. (_initialize_thread_db): Register "maint check libthread-db" and "maint set/show check-libthread-db". * NEWS: Mention the above new commands. gdb/doc/ChangeLog: * gdb.texinfo (Maintenance Commands): Document "maint check libthread-db" and "maint set/show check-libthread-db". gdb/testsuite/ChangeLog: * gdb.threads/check-libthread-db.exp: New file. * gdb.threads/check-libthread-db.c: Likewise.
2018-06-08Fix gdb mingw buildTom Tromey2-6/+11
I noticed that the mingw build was failing in the buildbot. This patch fixes the problem. I'm checking it in as obvious. gdb/ChangeLog 2018-06-08 Tom Tromey <tom@tromey.com> * windows-nat.c (windows_nat_target::xfer_partial): "beneath" is now a method.
2018-06-08[arm][gas] Add support for Arm Cortex-A76kyrtka013-0/+9
This patch adds support to gas for -mcpu=cortex-a76 in the usual way. make check-gas passes without problems. 2018-06-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/tc-arm.c (arm_cpus): Add Cortex-A76 entry. * doc/c-arm.texi (-mcpu): Document cortex-a76.
2018-06-08[AArch64][gas] Add support for Arm Cortex-A76kyrtka013-0/+9
This patch adds support to gas for -mcpu=cortex-a76 in the usual way. make check-gas passes without problems. 2018-06-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/tc-aarch64.c (aarch64_cpus): Add Cortex-A76 entry. * doc/c-aarch64.texi (-mcpu): Document cortex-a76.
2018-06-08Remove last cleanup from btrace codeTom Tromey2-7/+8
This removes the last cleanup from btrace.c, replacing it with a use of unique_xmalloc_ptr. gdb/ChangeLog 2018-06-08 Tom Tromey <tom@tromey.com> * btrace.c (parse_xml_raw): Use gdb::unique_xmalloc_ptr.
2018-06-08Remove cleanups from btrace codeTom Tromey7-85/+80
This removes some cleanups from the btrace code by minorly C++-ifying struct btrace_data. gdb/ChangeLog 2018-06-08 Tom Tromey <tom@tromey.com> * common/btrace-common.h (struct btrace_data): Add constructor, destructor, move assignment operator. <empty, clear, fini>: New methods. <format>: Initialize. (btrace_data_init, btrace_data_fini, btrace_data_clear) (btrace_data_empty): Don't declare. * common/btrace-common.c (btrace_data_init): Remove. (btrace_data::fini): Rename from btrace_data_fini. (btrace_data::empty): Rename from btrace_data_empty. (btrace_data::clear): Rename from btrace_data_clear. Return bool. * btrace.h (make_cleanup_btrace_data): Don't declare. * btrace.c (btrace_add_pc, btrace_stitch_trace, btrace_clear) (parse_xml_btrace): Update. (do_btrace_data_cleanup, make_cleanup_btrace_data): Remove. (maint_btrace_clear_packet_history_cmd): Update. gdb/gdbserver/ChangeLog 2018-06-08 Tom Tromey <tom@tromey.com> * linux-low.c (linux_low_read_btrace): Update.
2018-06-08Prevent undefined FMOV instructions being accepted by the AArch64 assembler.Egeyar Bagcioglu7-3/+123
Detect illegal FMOV instructions that changes the size from 32 bits to 64 bits and vice versa. Add tests for these and other undefined FMOV instructions. PR 20319 gas * testsuite/gas/aarch64/illegal-3.s: Test if unallocated FMOV encodings are detected as undefined. * testsuite/gas/aarch64/illegal-3.d: Likewise. * testsuite/gas/aarch64/illegal.s: Test if FMOV instructions that are changing the size from 32 bits to 64 bits and vice versa trigger an error. * testsuite/gas/aarch64/illegal.l: Likewise. opcodes * aarch64-tbl.h: Introduce QL_INT2FP_FMOV and QL_FP2INT_FMOV. (aarch64_opcode_table) : Use QL_INT2FP_FMOV and QL_FP2INT_FMOV.
2018-06-08Define various symbols conditionally in shared librariesAlan Modra268-2108/+2241
The values of symbols in shared libraries like _end, _edata, and __bss_start are generally not that useful outside of the shared library. This patch defines them conditionally with PROVIDE, since a shared library might need the local value. An example is glibc ld.so local access to "_begin", "_etext" and "_end". (ld.so gains access to the local values by making the references using hidden visibility. That makes the definitions hidden too.) We can't use PROVIDE_HIDDEN in the linker scripts because the shared library might need the value of the symbol in the executable. An example is freebsd libc dynamic access to "_end". PR ld/23161 * emulparams/aarch64cloudabi.sh: PROVIDE __bss_start__, _bss_end__, and __end__ in shared libraries. * emulparams/aarch64fbsd.sh: Likewise. * emulparams/aarch64linux.sh: Likewise. * emulparams/aarch64linux32.sh: Likewise. * emulparams/armelf_fuchsia.sh: Likewise. * emulparams/armelf_linux.sh: Likewise. * emulparams/armelf_phoenix.sh: Likewise. * emulparams/aarch64elf.sh: Likewise, and __data_start * emulparams/aarch64elf32.sh: Likewise. * emulparams/armelf.sh: Likewise. * emulparams/armnto.sh: Likewise. * emulparams/elf32bmip.sh: Remove duplicate ". = ." from OTHER_GOT_SYMBOLS. PROVIDE _ftext, _fdata, and _fbss in shared libs. * emulparams/elf32bmipn32-defs.sh: Likewise. * emulparams/elf32frv.sh: PROVIDE __end and __data_start in shared libs. * emulparams/elf32lriscv-defs.sh: Tidy. * emulparams/elf32mcore.sh: PROVIDE __bss_start and _bss_end in shared libs * emulparams/elf32ppccommon.sh: PROVIDE __end in shared libs. * emulparams/elf32rl78.sh: Tidy. * emulparams/i386nto.sh: PROVIDE _btext in shared libs. * emulparams/shelf_nto.sh: Likewise. * emulparams/shlelf_nto.sh: Likewise. * emulparams/score3_elf.sh: PROVIDE _gp, _bss_start__, _bss_end__, __bss_end__, __end__, _fdata, _sdata_begin, and _bss_start in shared libs. * scripttempl/elf.sc: Don't use EXECUTABLE_SYMBOLS for shared libraries. PROVIDE _edata, edata, __bss_start, and _end in shared libraries. * testsuite/ld-elf/pr23161.map, * testsuite/ld-elf/pr23161a.c, * testsuite/ld-elf/pr23161b.c, * testsuite/ld-elf/pr23161c.c, * testsuite/ld-elf/pr23161a.rd, * testsuite/ld-elf/pr23161b.rd, * testsuite/ld-elf/pr23161c.rd, * testsuite/ld-elf/pr23161d.rd: New tests. * testsuite/ld-elf/shared.exp: Run ld/23161 tests. * testsuite/ld-elf/pr23162.rd, * testsuite/ld-aarch64/ifunc-1-local.d, * testsuite/ld-aarch64/ifunc-1.d, * testsuite/ld-aarch64/ifunc-2-local.d, * testsuite/ld-aarch64/ifunc-2.d, * testsuite/ld-aarch64/ifunc-21.d, * testsuite/ld-aarch64/ifunc-3a.d, * testsuite/ld-alpha/tlsbin.rd, * testsuite/ld-alpha/tlsbin.sd, * testsuite/ld-alpha/tlsbinr.rd, * testsuite/ld-alpha/tlspic.rd, * testsuite/ld-alpha/tlspic.sd, * testsuite/ld-cris/dso-pltdis1.d, * testsuite/ld-cris/dso-pltdis2.d, * testsuite/ld-cris/dso12-pltdis.d, * testsuite/ld-cris/gotplt1.d, * testsuite/ld-cris/gotplt2.d, * testsuite/ld-cris/gotplt3.d, * testsuite/ld-cris/hiddef1.d, * testsuite/ld-cris/libdso-1.d, * testsuite/ld-cris/libdso-10.d, * testsuite/ld-cris/libdso-11.d, * testsuite/ld-cris/libdso-12.d, * testsuite/ld-cris/libdso-12b.d, * testsuite/ld-cris/libdso-12c.d, * testsuite/ld-cris/libdso-13.d, * testsuite/ld-cris/libdso-13b.d, * testsuite/ld-cris/libdso-14.d, * testsuite/ld-cris/libdso-15.d, * testsuite/ld-cris/libdso-15b.d, * testsuite/ld-cris/libdso-1c.d, * testsuite/ld-cris/libdso-1d.d, * testsuite/ld-cris/libdso-2.d, * testsuite/ld-cris/pic-gc-72.d, * testsuite/ld-cris/pic-gc-73.d, * testsuite/ld-cris/pr16044.d, * testsuite/ld-cris/pv32-1.d, * testsuite/ld-cris/tls-dso-dtpoffd2.d, * testsuite/ld-cris/tls-dso-dtpoffd4.d, * testsuite/ld-cris/tls-dso-tpoffgotcomm1.d, * testsuite/ld-cris/tls-gc-71.d, * testsuite/ld-cris/tls-gd-1.d, * testsuite/ld-cris/tls-gd-1h.d, * testsuite/ld-cris/tls-gd-2.d, * testsuite/ld-cris/tls-gd-2h.d, * testsuite/ld-cris/tls-ie-10.d, * testsuite/ld-cris/tls-ie-11.d, * testsuite/ld-cris/tls-ie-78.d, * testsuite/ld-cris/tls-ie-8.d, * testsuite/ld-cris/tls-ie-9.d, * testsuite/ld-cris/tls-js1.d, * testsuite/ld-cris/tls-ld-4.d, * testsuite/ld-cris/tls-ld-5.d, * testsuite/ld-cris/tls-ld-6.d, * testsuite/ld-cris/tls-ld-7.d, * testsuite/ld-cris/tls-ldgd-14.d, * testsuite/ld-cris/tls-ldgd-15.d, * testsuite/ld-cris/tls-ldgdex-14.d, * testsuite/ld-cris/tls-ldgdex-15.d, * testsuite/ld-cris/tls-ldgdx-14.d, * testsuite/ld-cris/tls-ldgdx-15.d, * testsuite/ld-cris/tls-legdx-16.d, * testsuite/ld-cris/tls-legdx-17.d, * testsuite/ld-cris/tls-local-54.d, * testsuite/ld-cris/tls-local-60.d, * testsuite/ld-cris/tls-local-61.d, * testsuite/ld-cris/tls-local-63.d, * testsuite/ld-cris/tls-local-64.d, * testsuite/ld-cris/tls-ok-30.d, * testsuite/ld-cris/tls-ok-32.d, * testsuite/ld-cris/tls-ok-34.d, * testsuite/ld-cris/tls-und-38.d, * testsuite/ld-cris/tls-und-42.d, * testsuite/ld-cris/tls-und-46.d, * testsuite/ld-cris/tls-und-50.d, * testsuite/ld-cris/weakhiddso.d, * testsuite/ld-cris/weakref2.d, * testsuite/ld-frv/fdpic-shared-1.d, * testsuite/ld-frv/fdpic-shared-2.d, * testsuite/ld-frv/fdpic-shared-3.d, * testsuite/ld-frv/fdpic-shared-4.d, * testsuite/ld-frv/fdpic-shared-5.d, * testsuite/ld-frv/fdpic-shared-7.d, * testsuite/ld-frv/fdpic-shared-8.d, * testsuite/ld-frv/tls-dynamic-2.d, * testsuite/ld-i386/ibt-plt-1.d, * testsuite/ld-i386/ibt-plt-2a.d, * testsuite/ld-i386/ibt-plt-2b.d, * testsuite/ld-i386/ibt-plt-2c.d, * testsuite/ld-i386/ibt-plt-2d.d, * testsuite/ld-i386/ibt-plt-3a.d, * testsuite/ld-i386/ibt-plt-3b.d, * testsuite/ld-i386/ibt-plt-3c.d, * testsuite/ld-i386/ibt-plt-3d.d, * testsuite/ld-i386/plt2.dd, * testsuite/ld-i386/pr20830.d, * testsuite/ld-i386/tlsbin-nacl.rd, * testsuite/ld-i386/tlsbin.rd, * testsuite/ld-i386/tlsbin2-nacl.rd, * testsuite/ld-i386/tlsbin2.rd, * testsuite/ld-i386/tlsbindesc-nacl.rd, * testsuite/ld-i386/tlsbindesc.rd, * testsuite/ld-i386/tlsdesc-nacl.rd, * testsuite/ld-i386/tlsdesc.rd, * testsuite/ld-i386/tlsgdesc-nacl.rd, * testsuite/ld-i386/tlsgdesc.rd, * testsuite/ld-i386/tlsnopic-nacl.rd, * testsuite/ld-i386/tlsnopic.dd, * testsuite/ld-i386/tlsnopic.rd, * testsuite/ld-i386/tlsnopic.sd, * testsuite/ld-i386/tlspic-nacl.rd, * testsuite/ld-i386/tlspic.rd, * testsuite/ld-i386/tlspic2-nacl.rd, * testsuite/ld-i386/tlspic2.rd, * testsuite/ld-ia64/merge1.d, * testsuite/ld-ia64/merge2.d, * testsuite/ld-ia64/merge3.d, * testsuite/ld-ia64/merge4.d, * testsuite/ld-ia64/merge5.d, * testsuite/ld-ia64/tlsbin.rd, * testsuite/ld-ia64/tlspic.rd, * testsuite/ld-ifunc/ifunc-2-i386-now.d, * testsuite/ld-ifunc/ifunc-2-local-i386-now.d, * testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d, * testsuite/ld-ifunc/ifunc-2-local-x86-64.d, * testsuite/ld-ifunc/ifunc-2-x86-64-now.d, * testsuite/ld-ifunc/ifunc-2-x86-64.d, * testsuite/ld-ifunc/pr17154-i386-now.d, * testsuite/ld-ifunc/pr17154-i386.d, * testsuite/ld-ifunc/pr17154-x86-64-now.d, * testsuite/ld-ifunc/pr17154-x86-64.d, * testsuite/ld-m68k/tls-def-1.d, * testsuite/ld-m68k/tls-gd-1.d2, * testsuite/ld-metag/shared.d, * testsuite/ld-metag/stub_pic_app.d, * testsuite/ld-mips-elf/rel32-n32.d, * testsuite/ld-mips-elf/rel32-o32.d, * testsuite/ld-mips-elf/rel64.d, * testsuite/ld-powerpc/ambiguousv1.d, * testsuite/ld-powerpc/ambiguousv1b.d, * testsuite/ld-powerpc/ambiguousv2.d, * testsuite/ld-powerpc/ambiguousv2b.d, * testsuite/ld-powerpc/tlsexe.d, * testsuite/ld-powerpc/tlsexe.r, * testsuite/ld-powerpc/tlsexe32.d, * testsuite/ld-powerpc/tlsexe32.g, * testsuite/ld-powerpc/tlsexe32.r, * testsuite/ld-powerpc/tlsexetoc.d, * testsuite/ld-powerpc/tlsexetoc.r, * testsuite/ld-powerpc/tlsso.d, * testsuite/ld-powerpc/tlsso.r, * testsuite/ld-powerpc/tlsso32.g, * testsuite/ld-powerpc/tlsso32.r, * testsuite/ld-powerpc/tlstocso.d, * testsuite/ld-powerpc/tlstocso.g, * testsuite/ld-powerpc/tlstocso.r, * testsuite/ld-s390/gotreloc_31-1.dd, * testsuite/ld-s390/tlsbin.dd, * testsuite/ld-s390/tlsbin.rd, * testsuite/ld-s390/tlsbin_64.dd, * testsuite/ld-s390/tlsbin_64.rd, * testsuite/ld-s390/tlspic.rd, * testsuite/ld-s390/tlspic_64.rd, * testsuite/ld-sh/tlsbin-2.d, * testsuite/ld-sh/tlspic-2.d, * testsuite/ld-sparc/gotop32.rd, * testsuite/ld-sparc/gotop64.rd, * testsuite/ld-sparc/tlssunbin32.rd, * testsuite/ld-sparc/tlssunbin64.rd, * testsuite/ld-sparc/tlssunnopic32.rd, * testsuite/ld-sparc/tlssunnopic64.rd, * testsuite/ld-sparc/tlssunpic32.rd, * testsuite/ld-sparc/tlssunpic64.rd, * testsuite/ld-x86-64/bnd-branch-1-now.d, * testsuite/ld-x86-64/bnd-ifunc-1-now.d, * testsuite/ld-x86-64/bnd-ifunc-2-now.d, * testsuite/ld-x86-64/bnd-ifunc-2.d, * testsuite/ld-x86-64/bnd-plt-1-now.d, * testsuite/ld-x86-64/bnd-plt-1.d, * testsuite/ld-x86-64/ibt-plt-1-x32.d, * testsuite/ld-x86-64/ibt-plt-1.d, * testsuite/ld-x86-64/ibt-plt-2a-x32.d, * testsuite/ld-x86-64/ibt-plt-2a.d, * testsuite/ld-x86-64/ibt-plt-2b-x32.d, * testsuite/ld-x86-64/ibt-plt-2b.d, * testsuite/ld-x86-64/ibt-plt-2c-x32.d, * testsuite/ld-x86-64/ibt-plt-2c.d, * testsuite/ld-x86-64/ibt-plt-2d-x32.d, * testsuite/ld-x86-64/ibt-plt-2d.d, * testsuite/ld-x86-64/ibt-plt-3a-x32.d, * testsuite/ld-x86-64/ibt-plt-3a.d, * testsuite/ld-x86-64/ibt-plt-3b-x32.d, * testsuite/ld-x86-64/ibt-plt-3b.d, * testsuite/ld-x86-64/ibt-plt-3c-x32.d, * testsuite/ld-x86-64/ibt-plt-3c.d, * testsuite/ld-x86-64/ibt-plt-3d-x32.d, * testsuite/ld-x86-64/ibt-plt-3d.d, * testsuite/ld-x86-64/ilp32-4-nacl.d, * testsuite/ld-x86-64/ilp32-4.d, * testsuite/ld-x86-64/load1c-nacl.d, * testsuite/ld-x86-64/load1c.d, * testsuite/ld-x86-64/load1d-nacl.d, * testsuite/ld-x86-64/load1d.d, * testsuite/ld-x86-64/mpx3n.dd, * testsuite/ld-x86-64/mpx4.dd, * testsuite/ld-x86-64/mpx4n.dd, * testsuite/ld-x86-64/plt2.dd, * testsuite/ld-x86-64/pr14207.d, * testsuite/ld-x86-64/pr19162.d, * testsuite/ld-x86-64/pr20253-1f.d, * testsuite/ld-x86-64/pr20253-1l.d, * testsuite/ld-x86-64/pr20830a-now.d, * testsuite/ld-x86-64/pr20830a.d, * testsuite/ld-x86-64/pr20830b-now.d, * testsuite/ld-x86-64/pr20830b.d, * testsuite/ld-x86-64/pr21038a-now.d, * testsuite/ld-x86-64/pr21038a.d, * testsuite/ld-x86-64/pr21038b-now.d, * testsuite/ld-x86-64/pr21038b.d, * testsuite/ld-x86-64/pr21038c-now.d, * testsuite/ld-x86-64/pr21038c.d, * testsuite/ld-x86-64/tlsbin-nacl.rd, * testsuite/ld-x86-64/tlsbin.rd, * testsuite/ld-x86-64/tlsbin2-nacl.rd, * testsuite/ld-x86-64/tlsbin2.rd, * testsuite/ld-x86-64/tlsbindesc-nacl.rd, * testsuite/ld-x86-64/tlsbindesc.rd, * testsuite/ld-x86-64/tlsdesc-nacl.rd, * testsuite/ld-x86-64/tlsdesc.rd, * testsuite/ld-x86-64/tlsgdesc-nacl.rd, * testsuite/ld-x86-64/tlsgdesc.rd, * testsuite/ld-x86-64/tlspic-nacl.rd, * testsuite/ld-x86-64/tlspic.rd, * testsuite/ld-x86-64/tlspic2-nacl.rd, * testsuite/ld-x86-64/tlspic2.rd: Update.
2018-06-08Automatic date update in version.inGDB Administrator1-1/+1
2018-06-07Add ChangeLog entry for e5a77256e8961294b3ea7d483124834311ca363bSergio Durigan Junior1-0/+5
I forgot to add a ChangeLog entry for my previous commit: commit e5a77256e8961294b3ea7d483124834311ca363b Author: Sergio Durigan Junior <sergiodj@redhat.com> Date: Tue Jun 5 17:55:39 2018 -0400 Guard declarations of 'sve_{vq,vl}_from_{vl,vq}' macros on Aarch64 (and unbreak build) This commit fixes that.
2018-06-07Introduce class target_stackPedro Alves3-62/+119
Currently, the target stack is represented by a singly linked list, with target_ops having a pointer to the target beneath. This poses a problem for multi-process / multi-target debugging. In that case, we will naturally want multiple instances of target stacks. E.g., one stack for inferior 1 which is debugging a core file, and another target stack for inferior 2 which is debugging a remote process. The problem then is in finding a target's "beneath" target, if we consider that for some target_ops types, we'll be sharing a single target_ops instance between several inferiors. For example, so far, I found no need to have multiple instances of the spu_multiarch_target / exec_target / dummy_target targets. Thus this patch, which changes the target stack representation to an array of pointers. For now, there's still a single global instance of this new target_stack class, though further down in the multi-target work, each inferior will have its own instance. gdb/ChangeLog: 2018-06-07 Pedro Alves <palves@redhat.com> * target.h (target_ops) <beneath>: Now a method. All references updated. (class target_stack): New. * target.c (g_target_stack): New. (g_current_top_target): Delete. (current_top_target): Get the top target out of g_target_stack. (target_stack::push, target_stack::unpush): New. (push_target, unpush_target): Reimplement. (target_is_pushed): Reimplement in terms of g_target_stack. (target_ops::beneath, target_stack::find_beneath): New.
2018-06-07Eliminate find_target_beneathPedro Alves9-128/+69
Call target_ops::beneath() throughout instead. gdb/ChangeLog: 2018-06-07 Pedro Alves <palves@redhat.com> * target.h (find_target_beneath): Delete declaration. * target.c (find_target_beneath): Delete definition. * aix-thread.c: All callers of find_target_beneath adjusted to call target_ops::beneath instead. * bsd-uthread.c: Likewise. * linux-thread-db.c: Likewise. * ravenscar-thread.c: Likewise. * sol-thread.c: Likewise. * spu-multiarch.c: Likewise.
2018-06-07target_ops::beneath -> target_ops::beneath()Pedro Alves10-747/+747
This changes target_ops::beneath from a pointer to a method, and adjusts all references throughout. The idea here is to make it easier to change the target stack representation from an intrusive singly linked list to something else without leaking implementation details throughout. The commit does not change the representation yet, that will be done in a following patch. That is why a new target_ops::m_beneath field appears here. That new field isn't really documented properly or made private, simply because it will be removed shortly. Note that target_ops::beneath() is essentially the same as the current find_target_beneath routine. The following patch will eliminate the latter. gdb/ChangeLog: 2018-06-07 Pedro Alves <palves@redhat.com> * target.h (target_ops) <beneath>: Now a method. All references updated. (target_ops) <m_beneath>: New. * target.c (target_ops::beneath): New. * corelow.c: Adjust all references to target_ops::beneath. * linux-thread-db.c: Likewise. * make-target-delegates: Likewise. * record-btrace.c: Likewise. * record-full.c: Likewise. * remote.c: Likewise. * target.c: Likewise. * target-delegates.c: Regenerate.
2018-06-07target_stack -> current_top_target() throughoutPedro Alves49-305/+378
The recent C++ification of target_ops replaced references to the old "current_target" squashed target throughout with references to a "target_stack" pointer. I had picked the "target_stack" name very early in the multi-target work, and managed to stick with it, even though it's a bit of a misnomer, since it isn't really a "target stack" object, but a pointer into the current top target in the stack. As I'm splitting more pieces off of the multi-target branch, I've come to think that it's better to rename it now. A following patch will introduce a new class to represent a target stack, and "target_stack" would be _its_ ideal name. (In the branch, the class is called a_target_stack to work around the clash.) Thus this commit renames target_stack to current_top_target and replaces all references throughout. Also, while at it, current_top_target is made a function instead of a pointer, to make it possible to change its internal implementation without leaking implementation details out. In a couple patches, the implementation of the function will change to refer to a target stack object, and then further down the multi-target work, it'll change again to find the right target stack for the current inferior. gdb/ChangeLog: 2018-06-07 Pedro Alves <palves@redhat.com> * target.h (target_stack): Delete. (current_top_target): Declare function. * target.c (target_stack): Delete. (g_current_top_target): New. (current_top_target): New function. * auxv.c: Use current_top_target instead of target_stack throughout. * avr-tdep.c: Likewise. * breakpoint.c: Likewise. * corefile.c: Likewise. * elfread.c: Likewise. * eval.c: Likewise. * exceptions.c: Likewise. * frame.c: Likewise. * gdbarch-selftests.c: Likewise. * gnu-v3-abi.c: Likewise. * ia64-tdep.c: Likewise. * ia64-vms-tdep.c: Likewise. * infcall.c: Likewise. * infcmd.c: Likewise. * infrun.c: Likewise. * linespec.c: Likewise. * linux-tdep.c: Likewise. * minsyms.c: Likewise. * ppc-linux-nat.c: Likewise. * ppc-linux-tdep.c: Likewise. * procfs.c: Likewise. * regcache.c: Likewise. * remote.c: Likewise. * rs6000-tdep.c: Likewise. * s390-linux-nat.c: Likewise. * s390-tdep.c: Likewise. * solib-aix.c: Likewise. * solib-darwin.c: Likewise. * solib-dsbt.c: Likewise. * solib-spu.c: Likewise. * solib-svr4.c: Likewise. * solib-target.c: Likewise. * sparc-tdep.c: Likewise. * sparc64-tdep.c: Likewise. * spu-tdep.c: Likewise. * symfile.c: Likewise. * symtab.c: Likewise. * target-descriptions.c: Likewise. * target-memory.c: Likewise. * target.c: Likewise. * target.h: Likewise. * tracefile-tfile.c: Likewise. * tracepoint.c: Likewise. * valops.c: Likewise. * valprint.c: Likewise. * value.c: Likewise. * windows-tdep.c: Likewise. * mi/mi-main.c: Likewise.