aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-05-01gdb/MAINTAINERS: Move Daniel J and Mark to the Past Maintainers section.Joel Brobecker2-13/+9
gdb/ChangeLog: * MAINTAINERS: Move Daniel Jacobowitz and Mark Kettenis to the past maintainers section.
2017-05-01merge_gnu_build_notes reloc deletionAlan Modra2-5/+13
If moving relocs, the next reloc to look at is at the same location. * objcopy.c (merge_gnu_build_notes): Correct code deleting relocs.
2017-05-01Automatic date update in version.inGDB Administrator1-1/+1
2017-04-30Automatic date update in version.inGDB Administrator1-1/+1
2017-04-29PR21432, buffer overflow in perform_relocationAlan Modra2-12/+27
The existing reloc offset range tests didn't catch small negative offsets less than the size of the reloc field. PR 21432 * reloc.c (reloc_offset_in_range): New function. (bfd_perform_relocation, bfd_install_relocation): Use it. (_bfd_final_link_relocate): Likewise.
2017-04-28Make environ.exp run on all platforms (and create info-program.exp)Sergio Durigan Junior3-252/+106
This has been on my TODO list for a while. There's a really old bug about this (PR testsuite/8595), and there was no reason for environ.exp to be specific for hppa* targets. So this patch removes this constraint, modernizes the testcase, and cleans up some things. Most of the tests remained, and some were rewritten (especially the one that checks if "show environment" works, which is something kind of hard to do). As a bonus, I'm adding a separated info-program.exp file containing all the tests related to "info program" that were present on environ.exp. Tested locally, everything still passes. gdb/testsuite/ChangeLog: 2017-04-28 Sergio Durigan Junior <sergiodj@redhat.com> PR testsuite/8595 * gdb.base/environ.exp: Make test available in all architectures. Move bits related to "info program" testing to gdb.base/info-program.exp. Rewrite tests to use the two new procedures mentione below. (test_set_show_env_var) New procedure. (test_set_show_env_var_equal): Likewise. * gdb.base/info-program.exp: New file.
2017-04-29Automatic date update in version.inGDB Administrator1-1/+1
2017-04-28Remove cleanup in get_return_valueYao Qi2-11/+8
With regcache ctor, we can use it to create local object in get_return_value (), so that the cleanup can be removed. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * infcmd.c (get_return_value): Use regcache ctor, and remove cleanup.
2017-04-28Use tag dispatch regcache ctor in regcache_dupYao Qi3-17/+34
This patch adds a tag dispatch ctor to create read-only regcache from a write-through regcache, also this patch deletes copy ctor and assignment operator. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> Pedro Alves <palves@redhat.com> * regcache.c (regcache::regcache): New tag dispatch ctor. (do_cooked_read): Moved above. (regcache_dup): Use the tag dispatch ctor.. * regcache.h (regcache): Declare ctor, delete copy ctor and assignment operator, remove friend regcache_dup.
2017-04-28Simplify regcache_dupYao Qi3-1/+11
regcache_dup, in fact, is to create a readonly regcache from a non-readonly regcache. This patch adds an assert that src is not readonly. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache_dup): Assert !src->m_readonly_p and call method save instead of regcache_cpy. * regcache.h (struct regcache): Make regcache_dup a friend.
2017-04-28Class-fy regcacheYao Qi4-334/+627
This patch moves regcache declaration to regcache.h, and converts regcache apis to member functions, for example, regcache_invalidate is changed to regcache::invalidate. This patch also add "m_" prefix to these private fields. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * regcache.c (struct regcache): Move to regcache.h (regcache::arch): New method. (regcache_get_ptid): Update. (get_regcache_arch): Call arch method. (get_regcache_aspace): Call method aspace. (register_buffer): Change it to method. (regcache_save): Change it to regcache::save. (regcache_restore): Likewise. (regcache_cpy_no_passthrough): Remove the declaration. (regcache_cpy): Call methods restore and cpy_no_passthrough. (regcache_cpy_no_passthrough): Change it to method cpy_no_passthrough. (regcache_register_status): Change it to method get_register_status. (regcache_invalidate): Change it to method invalidate. (regcache_thread_ptid_changed): Use methods ptid and set_ptid. (regcache_raw_update): Change it to method raw_update. (regcache_raw_read): Likewise. (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_raw_write_signed): Likewise. (regcache_raw_write_unsigned): Likewise. (regcache_cooked_read): Likewise. (regcache_cooked_read_value): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. (regcache_cooked_write_signed): Likewise. (regcache_cooked_write_unsigned): Likewise. (regcache_raw_set_cached_value): Likewise. (regcache_raw_write): Likewise. (regcache_cooked_write): Likewise. (regcache_xfer_part): Likewise. (regcache_raw_read_part): Likewise. (regcache_raw_write_part): Likewise. (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. (regcache_raw_supply): Likewise. (regcache_raw_collect): Likewise. (regcache_transfer_regset): Likewise. (regcache_supply_regset): Likewise. (regcache_collect_regset): Likewise. (regcache_debug_print_register): Likewise. (enum regcache_dump_what): Move it to regcache.h. (regcache_dump): Change it to method dump. * regcache.h (enum regcache_dump_what): New. (class regcache): New. * target.c (target_fetch_registers): Call method debug_print_register. (target_store_registers): Likewise.
2017-04-28Class-ify lm_info_windowsSimon Marchi2-4/+11
This patch makes lm_info_windows a "real" class. It initializes the field and replaces XCNEW/xfree with new/delete. gdb/ChangeLog: * windows-nat.c (struct lm_info_windows): Initialize field. (windows_make_so): Allocate lm_info_windows with new. (windows_free_so): Free lm_info_windows with delete.
2017-04-28Class-ify lm_info_darwinSimon Marchi2-3/+12
This patch makes lm_info_darwin a "real" class. It initializes the field and replaces XCNEW/xfree with new/delete. gdb/ChangeLog: * solib-darwin.c (struct lm_info_darwin): Initialize field. (darwin_current_sos): Allocate lm_info_darwin with new, remove cleanup. (darwin_free_so): Free lm_info_darwin with delete.
2017-04-28Class-ify lm_info_svr4Simon Marchi3-10/+23
This patch makes lm_info_svr4 a "real" class. It initializes fields, uses bool and replaces XCNEW/xfree with new/delete. The memcpy in svr4_copy_library_list is replaced by a usage of the default copy constructor. gdb/ChangeLog: * solib-svr4.h (struct lm_info_svr4): Initialize fields. <l_addr_p>: Change type to bool. * solib-svr4.c (lm_info_read): Allocate lm_info_svr4 with new. (svr4_free_so): Free lm_info_svr4 with delete. (svr4_copy_library_list): Replace memcpy with call to copy constructor. (library_list_start_library, svr4_default_sos): Allocate lm_info_svr4 with new.
2017-04-28Class-ify lm_info_targetSimon Marchi2-19/+31
This patch makes lm_info_target a "real" class. It adds a destructor, uses std::string, initializes the fields and replaces XCNEW/xfree with new/delete. gdb/ChangeLog: * solib-target.c (struct lm_info_target): Add destructor, initialize fields. <name>: Change type to std::string. (library_list_start_library): Allocate lm_info_target with new. (solib_target_free_library_list): Free lm_info_target with delete. (solib_target_current_sos): Adapt to std::string. (solib_target_free_so): Free lm_info_target with delete.
2017-04-28Class-ify lm_info_frvSimon Marchi2-23/+28
This patches makes lm_info_frv a "real" class. It adds a destructor, initializes the fields and replaces XCNEW/xfree with new/delete. gdb/ChangeLog: * solib-frv.c (struct lm_info_frv): Add destructor, initialize fields. (frv_current_sos): Allocate lm_info_frv with new. (frv_relocate_main_executable): Free lm_info_frv with delete, allocate with new. (frv_clear_solib, frv_free_so): Free lm_info_frv with delete.
2017-04-28Fix indentation of lm_info_frvSimon Marchi2-23/+28
This patch fixes the indentation of lm_info_frv, so that the real changes of the following patch are not lost in the reformatting. gdb/ChangeLog: * solib-frv.c (struct lm_info_frv): Fix indentation.
2017-04-28Class-ify lm_info_dsbtSimon Marchi2-12/+22
This patches makes lm_info_dsbt a "real" class. It introduces a destructor, initializes the field and replaces XCNEW/xfree with new/delete. gdb/ChangeLog: * solib-dsbt.c (struct lm_info_dsbt): Add destructor, initialize map field. (dsbt_current_sos): Allocate lm_info_dsbt with new. (dsbt_relocate_main_executable): Free lm_info_dsbt with delete and allocate with new. (dsbt_clear_solib, dsbt_free_so): Free lm_info_dsbt with delete.
2017-04-28Class-ify lm_info_aixSimon Marchi2-41/+31
This patch makes lm_info_aix a "real" class. It uses std::string, initializes fields in-class and replaces XCNEW/xfree with new/delete. The solib_aix_new_lm_info can be replaced by using the default copy constructor. gdb/ChangeLog: * solib-aix.c (struct lm_info_aix): Initialize fields in-class. <filename, member_name>: Change type to std::string. (solib_aix_new_lm_info, solib_aix_xfree_lm_info): Remove. (library_list_start_library): Allocate lm_info_aix with new. (solib_aix_free_library_list, solib_aix_free_so): Free with delete. (solib_aix_current_sos): Adapt to std::string, copy lm_info_aix with copy constructor.
2017-04-28Make various lm_info implementations inherit from a base classSimon Marchi11-222/+291
The lm_info structure is used to store target specific information about mapped libraries. It is currently defined as an opaque type in solist.h and a pointer to it is included in solist, the target-agnostic object representing a loaded shared library. Multiple targets define their own implementation of lm_info. In anticipation of using C++ stuff (e.g. vector) in the lm_info objects, we first need to avoid different definitions of classes with the same name (which violates the one definition rule). This patch does it by having a base class (lm_info_base) from which all the specific lm_info derive. Each implementation is renamed to something that makes sense (e.g. lm_info_aix for AIX). The next logical step would probably be to derive directly from so_list, it's not really obvious, so I'll keep that for another day. One special case is the Neutrino (nto) support. It uses SVR4-style libraries, but overrides some methods. To do that, it needed to have its own copy of SVR4's lm_info structure in nto-tdep.c, because it was just not possible to put it in solib-svr4.h and include that file. Over time, that copy got out of sync, which is still the case today. I can only assume that the lm_addr function in nto-tdep.c is broken right now. The first field of the old lm_info was a pointer (gdb_byte *), whereas in the new lm_info it's an address in the inferior (CORE_ADDR). Trying to use that field today probably results in a crash. With this refactor, it's now possible to put lm_info_svr4 in solib-svr4.h and just include it. I have adapted the code in nto-tdep.c to that it builds, but it's probably not correct. Since I don't have the knowledge nor setup to try this on Neutrino, somebody else would have to fix it. But I am confident that I am not making things worse than they already are. gdb/ChangeLog: * solist.h (struct lm_info): Remove. (struct lm_info_base): New class. (struct so_list) <lm_info>: Change type to lm_info_base *. * nto-tdep.c (struct lm_info): Remove. (lm_addr): Adjust. * solib-aix.c (struct lm_info): Rename to ... (struct lm_info_aix): ... this. Extend lm_info_base. (lm_info_p): Rename to ... (lm_info_aix_p): ... this, and adjust. (solib_aix_new_lm_info, solib_aix_xfree_lm_info, solib_aix_parse_libraries, library_list_start_library, solib_aix_free_library_list, solib_aix_parse_libraries, solib_aix_get_library_list, solib_aix_relocate_section_addresses, solib_aix_free_so, solib_aix_get_section_offsets, solib_aix_solib_create_inferior_hook, solib_aix_current_sos): Adjust. (struct solib_aix_inferior_data) <library_list>: Adjust. * solib-darwin.c (struct lm_info): Rename to ... (struct lm_info_darwin): ... this. Extend lm_info_base. (darwin_current_sos, darwin_relocate_section_addresses): Adjust. * solib-dsbt.c (struct lm_info): Rename to ... (struct lm_info_dsbt): ... this. Extend lm_info_base. (struct dsbt_info) <main_executable_lm_info): Adjust. (dsbt_current_sos, dsbt_relocate_main_executable, dsbt_free_so, dsbt_relocate_section_addresses): Adjust. * solib-frv.c (struct lm_info): Rename to ... (struct lm_info_frv): ... this. Extend lm_info_base. (main_executable_lm_info): Adjust. (frv_current_sos, frv_relocate_main_executable, frv_free_so, frv_relocate_section_addresses, frv_fdpic_find_global_pointer, find_canonical_descriptor_in_load_object, frv_fdpic_find_canonical_descriptor): Adjust. * solib-svr4.c (struct lm_info): Move to solib-svr4.h, renamed to lm_info_svr4. (lm_info_read, lm_addr_check, svr4_keep_data_in_core, svr4_clear_so, svr4_copy_library_list, library_list_start_library, svr4_default_sos, svr4_read_so_list, svr4_current_sos, svr4_fetch_objfile_link_map, solist_update_incremental): Adjust. * solib-svr4.h (struct lm_info_svr4): Move here from solib-svr4.c. * solib-target.c (struct lm_info): Rename to ... (struct lm_info_target): ... this. Extend lm_info_base. (lm_info_p): Rename to ... (lm_info_target_p): ... this. (solib_target_parse_libraries, library_list_start_segment, library_list_start_section, library_list_start_library, library_list_end_library, solib_target_free_library_list, solib_target_current_sos, solib_target_free_so, solib_target_relocate_section_addresses): Adjust. * windows-nat.c (struct lm_info): Rename to ... (struct lm_info_windows): ... this. Extend lm_info_base. (windows_make_so, handle_load_dll, handle_unload_dll, windows_xfer_shared_libraries): Adjust.
2017-04-28Standardize darwin's lm_infoSimon Marchi2-13/+11
Darwin's lm_info structure is used a little bit differently than the other solib implementations. The other implementations first allocate an so_list object, then instanciate their specific lm_info structure, and assign it to so_list::lm_info. The Darwin implementation allocates both at the same time (darwin_so_list). This patch changes it to be like the others, so that we'll be able to do some generalizations later. gdb/ChangeLog: * solib-darwin.c (struct darwin_so_list): Remove. (darwin_current_sos): Allocate an so_list object instead of a darwin_so_list, separately allocate an lm_info object. (darwin_free_so): Free lm_info.
2017-04-28x86: Add run-time tests for -mtls-dialect=gnu2H.J. Lu8-0/+223
* testsuite/config/default.exp (GNU2_CFLAGS): New. Set to -mtls-dialect=gnu2 if target compiler supports it. * testsuite/ld-i386/tls.exp: Run -mtls-dialect=gnu2 tests. * testsuite/ld-x86-64/tls.exp: Likewise. * testsuite/ld-i386/tlsdesc1a.c: New file. * testsuite/ld-i386/tlsdesc1b.c: Likewise. * testsuite/ld-x86-64/tlsdesc1a.c: Likewise. * testsuite/ld-x86-64/tlsdesc1b.c: Likewise.
2017-04-28ELF: Add run-time tests for -z nowH.J. Lu5-0/+298
* testsuite/ld-elf/shared.exp: Add run-time tests for -z now. * testsuite/ld-i386/tls.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-x86-64/tls.exp: Likewise.
2017-04-28Consistently use fprintf_filtered when displaying MIPS registers.John Baldwin2-1/+6
One line was using printf_filtered instead of fprintf_filtered to the requested file. gdb/ChangeLog: * mips-tdep.c (print_gp_register_row): Replace printf_filtered with fprintf_filtered.
2017-04-28x86: Check plt_got before using .plt.gotH.J. Lu3-2/+12
Since the GOT procedure linkage table is supported only if plt_got isn't NULL, we need to check plt_got before using it. * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got before using .plt.got. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2017-04-28Add constructor and destructor to regcacheYao Qi2-36/+50
This patch adds ctor and dtor to regcache. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache::regcache): New function. (regcache::~regcache): New function. (regcache_xmalloc_1): Remove. (regcache_xmalloc): Call new regcache. (regcache_xfree): Call delete regcache. (get_thread_arch_aspace_regcache): Call new regcache.
2017-04-28Fix off by one error when checking for empty note names.Nick Clifton2-5/+16
PR binutils/21439 * readelf.c (print_gnu_build_attribute_name): Allow for an empty name field.
2017-04-28Fix heap-buffer address violation when reading version data from a corrupt ↵Nick Clifton2-2/+9
binary. PR binutils/21437 * readelf.c (process_version_sections): Check for underflow when computing the start address of the auxillary version data.
2017-04-28Fix heap-buffer overflow bugs caused when dumping debug information from a ↵Nick Clifton2-16/+60
corrupt binary. PR binutils/21438 * dwarf.c (process_extended_line_op): Do not assume that the string extracted from the section is NUL terminated. (fetch_indirect_string): If the string retrieved from the section is not NUL terminated, return an error message. (fetch_indirect_line_string): Likewise. (fetch_indexed_string): Likewise.
2017-04-28Use ptid method lwp in mips_linux_new_threadYao Qi2-1/+6
gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * mips-linux-nat.c (mips_linux_new_thread): Use ptid method lwp instead of ptid_get_lwp.
2017-04-28[MIPS] Use lwpid from lwp_info instead of inferior_ptidYao Qi2-3/+7
RAJESH reported that GDB gets "Couldn't write debug register: No such process." on mips64 when GDB attaches to a multi threaded application. Looks GDB nows PTRACE_GET_WATCH_REGS for inferior_ptid but PTRACE_SET_WATCH_REGS for lwp->ptid, they may be different. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * mips-linux-nat.c (mips_linux_new_thread): Get lwpid from lwp_info instead of getting from inferior_ptid.
2017-04-28Automatic date update in version.inGDB Administrator1-1/+1
2017-04-27Fix overload resolution involving rvalue references and cv qualifiers.Keith Seitz8-57/+119
The following patch fixes several outstanding overload resolution problems with rvalue references and cv qualifiers in the test suite. The tests for these problems typically passed with one compiler version and failed with another. This behavior occurs because of the ordering of the overloaded functions in the debug info. So the first best match "won out" over the a subsequent better match. One of the bugs addressed by this patch is the failure of rank_one_type to account for type equality of two overloads based on CV qualifiers. This was leading directly to problems evaluating rvalue reference overload quality, but it is also highlighted in gdb.cp/oranking.exp, where two test KFAIL as a result of this shortcoming. I found the overload resolution code committed with the rvalue reference patch (f9aeb8d49) needlessly over-complicated, and I have greatly simplified it. This fixes some KFAILing tests in gdb.exp/rvalue-ref-overload.exp. gdb/ChangeLog * gdbtypes.c (LVALUE_REFERENCE_TO_RVALUE_BINDING_BADNESS) DIFFERENT_REFERENCE_TYPE_BADNESS): Remove. (CV_CONVERSION_BADNESS): Define. (rank_one_type): Remove overly restrictive rvalue reference rank checks. Add cv-qualifier checks and subranks for type equality. * gdbtypes.h (REFERENCE_CONVERSION_RVALUE, REFERENCE_CONVERSION_CONST_LVALUE, CV_CONVERSION_BADNESS, CV_CONVERSION_CONST, CV_CONVERSION_VOLATILE): Declare. gdb/testsuite/ChangeLog * gdb.cp/oranking.cc (test15): New function. (main): Call test15 and declare additional variables for testing. * gdb.cp/oranking.exp: Remove kfail status for "p foo4(&a)" and "p foo101('abc')" tests. * gdb.cp/rvalue-ref-overloads.exp: Remove kfail status for "lvalue reference overload" test. * gdb.cp/rvalue-ref-params.exp: Remove kfail status for "print value of f1 on Child&& in f2" test.
2017-04-27x86-64: Use "=" instead of "+=" to update 0H.J. Lu2-1/+6
Use if (htab->elf.splt->size == 0) htab->elf.splt->size = GET_PLT_ENTRY_SIZE (output_bfd); instead of if (htab->elf.splt->size == 0) htab->elf.splt->size += GET_PLT_ENTRY_SIZE (output_bfd); * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "=" instead of "+=" to update 0.
2017-04-27Add missing incref when creating Inferior Python objectSimon Marchi2-2/+10
The test py-inferior.exp fails when using a debug build of Python 3.6. I don't see it failing with my system's default Python, but it might be related to the different memory allocation scheme used when doing a build with pydebug. The issue is that we are missing a Py_INCREF in inferior_to_inferior_object. The PyObject_New function initializes the object with a refcount of 1. If we assume that this refcount corresponds to the reference we are returning, then we are missing an incref for the reference in the inferior data. The counterpart for the incref that corresponds to the reference in the inferior data is in py_free_inferior, in the form the gdbpy_ref instance. Here's how I can get it to crash (with some debug output): $ ./gdb -nx -ex "set debug python 1" (gdb) add-inferior Added inferior 2 (gdb) python infs = gdb.inferiors() Creating Python Inferior object inf = 1 Creating Python Inferior object inf = 2 (gdb) remove-inferiors 2 py_free_inferior inf = 2 infpy_dealloc inf = <unknown> (gdb) python infs = None Fatal Python error: Objects/tupleobject.c:243 object at 0x7f9cf1a568d8 has negative ref count -1 Current thread 0x00007f9cf1b68780 (most recent call first): File "<string>", line 1 in <module> [1] 408 abort (core dumped) ./gdb -nx -ex "set debug python 1" After having created the inferiors object, their refcount is 1 (which comes from PyObject_New), but it should be two. The gdb inferior object has a reference and the "infs" list has a reference. When invoking remove-inferiors, py_free_inferior gets called. It does the decref that corresponds to the reference that the gdb inferior object kept. At this moment, the refcount drops to 0 and the object gets deallocated, even though the "infs" list still has a reference. When we set "infs" to None, Python tries to decref the already zero refcount and the assert triggers. With this patch, it looks better: (gdb) add-inferior Added inferior 2 (gdb) python infs = gdb.inferiors() Creating Python Inferior object inf = 1 Creating Python Inferior object inf = 2 (gdb) remove-inferiors 2 py_free_inferior inf = 2 (gdb) python infs = None infpy_dealloc inf = <unknown> gdb/ChangeLog: * python/py-inferior.c (inferior_to_inferior_object): Increment reference count when creating the object.
2017-04-27x86: Create dynamic sections in create_dynamic_sectionsH.J. Lu6-191/+185
This patch creates dynamic sections in i386/x86-64 create_dynamic_sections instead of creating them on demend. Linker will strip them if they are empty. It changes order in x86-64 .eh_frame section. The extra DW_CFA_nop paddings is due to https://sourceware.org/bugzilla/show_bug.cgi?id=21441 bfd/ * elf32-i386.c (elf_i386_create_dynamic_sections): Create the .plt.got section here. (elf_i386_check_relocs): Don't create the .plt.got section. * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create the .plt.got and .plt.bnd sections here. (elf_x86_64_check_relocs): Don't create the .plt.got nor .plt.bnd sections. ld/ * testsuite/ld-x86-64/pr21038a.d: Update DW_CFA_nop paddings in .eh_frame section. * testsuite/ld-x86-64/pr21038c.d: Update .eh_frame order.
2017-04-27Remove has_bnd_reloc from elf_x86_64_link_hash_entryH.J. Lu2-10/+13
has_bnd_reloc was added to elf_x86_64_link_hash_entry track BND relocations by commit 0ff2b86e7c14177ec7f9e1257f8e697814794017 Author: H.J. Lu <hjl.tools@gmail.com> Date: Wed Nov 20 09:01:04 2013 -0800 Create the second PLT for BND relocations Since BND relocations have been deprecated by commit d258b828287a863376af60a1ef7ceafbccc83d93 Author: Igor Zamyatin <igor.zamyatin@intel.com> Date: Tue Nov 18 10:52:36 2014 +0300 Add -z bndplt to generate BND prefix in PLT entries This patch removes has_bnd_reloc from elf_x86_64_link_hash_entry and checks bndplt instead of has_bnd_reloc. * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove has_bnd_reloc. (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc. (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc. (elf_x86_64_check_relocs): Don't set has_bnd_reloc. (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of has_bnd_reloc. Remove has_bnd_reloc
2017-04-27Change _bfd_elf_link_setup_gnu_properties to bfd *H.J. Lu3-6/+17
Change setup_gnu_properties to return the first relocatable ELF input with GNU properties so that a backend can make decision based on GNU properties. * elf-bfd.h (elf_backend_data): Change setup_gnu_properties to return bfd *. (_bfd_elf_link_setup_gnu_properties): Return bfd *. * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return the first relocatable ELF input with GNU properties.
2017-04-27i386: Simplify VxWorks for non-PICH.J. Lu2-32/+35
Change if (PIC) { #1 } else { #2 if (VxWorks) { #3 } } #4 if (VxWorks && !PIC) { #5 } to #4 if (PIC) { #1 } else { #2 if (VxWorks) { #3 #5 } } * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify VxWorks for non-PIC.
2017-04-27Read corrrect auxiliary entry in AIXUlrich Weigand2-25/+53
Fix handling of XCOFF function auxiliary entries, in particular when the xlc -qfuncsect or gcc -ffunction-sections compiler option is used in AIX. Also handle C_WEAKEXT storage class. gdb/ 2016-10-21 Sangamesh Mallayya <sangamesh.swamy@in.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * xcoffread.c (read_xcoff_symtab): Read correct function auxiliary entry if xlc -qfuncsect or gcc -ffunction-sections compiler option is used in AIX. (read_xcoff_symtab): Handle C_WEAKEXT storage class. (process_xcoff_symbol): Likewise. (scan_xcoff_symtab): Likewise. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2017-04-27MIPS16/GAS: Factor out duplicate symbol value conversion codeMaciej W. Rozycki2-92/+94
Factor out and consolidate duplicate section-relative to PC-relative symbol value conversion in `mips16_extended_frag' and `md_convert_frag' used for MIPS16 relaxation, observing that the final calculation in the latter function implies `stretch == 0'. Sanitize the formatting of code moved. gas/ * config/tc-mips.c (mips16_pcrel_val): New function, factored out from... (mips16_extended_frag): ... here. (md_convert_frag): Use `mips16_pcrel_val' rather than repeated code in MIPS16 relaxation, with `stretch' hardcoded to 0.
2017-04-27MIPS16/GAS: Rename the LONG_BRANCH relaxation flagMaciej W. Rozycki2-6/+16
Following commit 177b4a6ad004 ("infinite loop in mips16 assembler relaxation"), <https://sourceware.org/ml/binutils/2002-03/msg00345.html> the LONG_BRANCH flag used in MIPS16 relaxation has lost its use for branches. Complement commit 88a7ef168927 ("MIPS16/GAS: Restore unsupported relocation diagnostics") then, which has removed the remains of code deactivated by the former commit, and rename the flag to ALWAYS_EXTENDED, more accurately reflecting its current use to select the extended form of PC-relative ADDIU, DADDIU, LD and LW instructions. gas/ * config/tc-mips.c (RELAX_MIPS16_LONG_BRANCH): Rename to... (RELAX_MIPS16_ALWAYS_EXTENDED): ... this. (RELAX_MIPS16_MARK_LONG_BRANCH): Rename to... (RELAX_MIPS16_MARK_ALWAYS_EXTENDED): ... this. (RELAX_MIPS16_CLEAR_LONG_BRANCH): Rename to... (RELAX_MIPS16_CLEAR_ALWAYS_EXTENDED): ... this. (mips16_extended_frag): Adjust accordingly.
2017-04-27Remove some MAX_REGISTER_SIZE uses in ia64-tdep.cAlan Hayward2-41/+28
gdb/ * ia64-tdep.c (examine_prologue): Use get_frame_register_unsigned. (ia64_sigtramp_frame_prev_register): Use read_memory_unsigned_integer. (ia64_access_reg): Use get_frame_register_unsigned. (ia64_access_rse_reg): Likewise. (ia64_libunwind_frame_prev_register): Likewise.
2017-04-27Tidy S_FORCE_RELOCAlan Modra2-6/+14
Separate out symbol flag reasons from section reasons to force a reloc. Yes, this adds another section test to the local symbol case too. * symbols.c (S_FORCE_RELOC): Separate section and symbol tests.
2017-04-27Constify elf_backend_eh_frame_address_sizeAlan Modra7-12/+27
* elf-bfd.h (struct elf_backend_data): Make asection param of elf_backend_eh_frame_address_size const. (_bfd_elf_eh_frame_address_size): Likewise. * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise. * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise. * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise. * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise. * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise. (next_cie_fde_offset): Constify params. (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
2017-04-27Edit .eh_frame symbolsAlan Modra4-3/+185
Experimental support for moving symbols defined in .eh_frame as their CIEs/FDEs are edited or merged. * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len. (_bfd_elf_adjust_eh_frame_global_symbol): Declare. * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and aug_data_len. (offset_adjust): New function. (_bfd_elf_adjust_eh_frame_global_symbol): Likewise. (adjust_eh_frame_local_symbols): Likewise. (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols after changing anything. Return true if anything changed. * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call _bfd_elf_adjust_eh_frame_global_symbol for globals.
2017-04-27Clear dynstr_index when forcing symbols localAlan Modra2-1/+7
This is really just cosmetic, but it does protect a little from accidentally reading a stale value. * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index when force_local.
2017-04-27PowerPC undefweak handlingAlan Modra3-36/+41
This patch fixes a number of cases where -z nodynamic-undefined-weak was not effective in preventing dynamic relocations or linkage stubs. * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define. (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it. (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise. (ppc_elf_relocate_section): Likewise. Delete silly optimisation for undef and undefweak dyn_relocs. * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define. (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it. (allocate_got, allocate_dynrelocs): Likewise. (ppc64_elf_relocate_section): Likewise.
2017-04-27[GOLD] testsuite/plugin_section_order.c fixAlan Modra2-0/+5
* testsuite/plugin_section_order.c (onload): Add missing break.
2017-04-27Automatic date update in version.inGDB Administrator1-1/+1