diff options
author | Eric Christopher <echristo@gmail.com> | 2017-06-20 16:18:58 -0700 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2017-06-21 16:26:30 -0700 |
commit | b12fcc6e5ac25c21e01429455fe44b042123b5e5 (patch) | |
tree | 7de6e6ef2bd35fe8168ed645063a98bc6df1e070 | |
parent | 785bf16bde29835cbe22c845bb3df5d94151125e (diff) | |
download | gdb-b12fcc6e5ac25c21e01429455fe44b042123b5e5.zip gdb-b12fcc6e5ac25c21e01429455fe44b042123b5e5.tar.gz gdb-b12fcc6e5ac25c21e01429455fe44b042123b5e5.tar.bz2 |
2017-06-21 Eric Christopher <echristo@gmail.com>
Apply from master
2017-06-20 Eric Christopher <echristo@gmail.com>
* aarch64.cc (scan_reloc_for_stub): Use plt_address_for_global to
calculate the symbol value.
(scan_reloc_section_for_stubs): Allow stubs to be created for
section symbols.
(maybe_apply_stub): Handle creating stubs for weak symbols to
match the code in scan_reloc_for_stub.
-rw-r--r-- | gold/ChangeLog | 12 | ||||
-rw-r--r-- | gold/aarch64.cc | 21 |
2 files changed, 21 insertions, 12 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 3a2b3f3..4c65d4d 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,6 +1,18 @@ 2017-06-21 Eric Christopher <echristo@gmail.com> Apply from master + 2017-06-20 Eric Christopher <echristo@gmail.com> + + * aarch64.cc (scan_reloc_for_stub): Use plt_address_for_global to + calculate the symbol value. + (scan_reloc_section_for_stubs): Allow stubs to be created for + section symbols. + (maybe_apply_stub): Handle creating stubs for weak symbols to + match the code in scan_reloc_for_stub. + +2017-06-21 Eric Christopher <echristo@gmail.com> + + Apply from master 2017-06-15 Eric Christopher <echristo@gmail.com> * aarch64.cc: Fix a few typos and grammar-os. diff --git a/gold/aarch64.cc b/gold/aarch64.cc index 9d4ea50..9d8815a 100644 --- a/gold/aarch64.cc +++ b/gold/aarch64.cc @@ -3734,8 +3734,7 @@ Target_aarch64<size, big_endian>::scan_reloc_for_stub( if (gsym->use_plt_offset(arp->reference_flags())) { // This uses a PLT, change the symbol value. - symval.set_output_value(this->plt_section()->address() - + gsym->plt_offset()); + symval.set_output_value(this->plt_address_for_global(gsym)); psymval = &symval; } else if (gsym->is_undefined()) @@ -3968,11 +3967,6 @@ Target_aarch64<size, big_endian>::scan_reloc_section_for_stubs( psymval = &symval2; } - // If symbol is a section symbol, we don't know the actual type of - // destination. Give up. - if (psymval->is_section_symbol()) - continue; - this->scan_reloc_for_stub(relinfo, r_type, sym, r_sym, psymval, addend, view_address + offset); } // End of iterating relocs in a section @@ -5404,8 +5398,14 @@ maybe_apply_stub(unsigned int r_type, const The_aarch64_relobj* aarch64_relobj = static_cast<const The_aarch64_relobj*>(object); - // We don't create stubs for undefined symbols so don't look for one. - if (gsym && gsym->is_undefined()) + const AArch64_reloc_property* arp = + aarch64_reloc_property_table->get_reloc_property(r_type); + gold_assert(arp != NULL); + + // We don't create stubs for undefined symbols, but do for weak. + if (gsym + && !gsym->use_plt_offset(arp->reference_flags()) + && gsym->is_undefined()) { gold_debug(DEBUG_TARGET, "stub: looking for a stub for undefined symbol %s in file %s", @@ -5424,9 +5424,6 @@ maybe_apply_stub(unsigned int r_type, Address new_branch_target = stub_table->address() + stub->offset(); typename elfcpp::Swap<size, big_endian>::Valtype branch_offset = new_branch_target - address; - const AArch64_reloc_property* arp = - aarch64_reloc_property_table->get_reloc_property(r_type); - gold_assert(arp != NULL); typename This::Status status = This::template rela_general<32>(view, branch_offset, 0, arp); if (status != This::STATUS_OKAY) |