X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gold%2Faarch64.cc;h=07abe44931f34504a986bf30500f0a862b2a9570;hb=78f2c40a12179d26d3065c09f054b7e751b2732f;hp=8de9a26765e82a4c60d6cd93efed32fceadd486a;hpb=43193fe9fc39138c912095ba6f21c4302abafe5e;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/aarch64.cc b/gold/aarch64.cc index 8de9a26765..07abe44931 100644 --- a/gold/aarch64.cc +++ b/gold/aarch64.cc @@ -1,6 +1,6 @@ // aarch64.cc -- aarch64 target support for gold. -// Copyright (C) 2014-2018 Free Software Foundation, Inc. +// Copyright (C) 2014-2020 Free Software Foundation, Inc. // Written by Jing Yu and Han Shen . // This file is part of gold. @@ -6496,6 +6496,17 @@ Target_aarch64::Scan::global( gold_error(_("%s: unsupported reloc %u in pos independent link."), object->name().c_str(), r_type); } + // Make a PLT entry if necessary. + if (gsym->needs_plt_entry()) + { + target->make_plt_entry(symtab, layout, gsym); + // Since this is not a PC-relative relocation, we may be + // taking the address of a function. In that case we need to + // set the entry in the dynamic symbol table to the address of + // the PLT entry. + if (gsym->is_from_dynobj() && !parameters->options().shared()) + gsym->set_needs_dynsym_value(); + } break; case elfcpp::R_AARCH64_LD_PREL_LO19: // 273 @@ -6965,11 +6976,11 @@ Target_aarch64::do_finalize_sections( } // Set the size of the _GLOBAL_OFFSET_TABLE_ symbol to the size of - // the .got.plt section. + // the .got section. Symbol* sym = this->global_offset_table_; if (sym != NULL) { - uint64_t data_size = this->got_plt_->current_data_size(); + uint64_t data_size = this->got_->current_data_size(); symtab->get_sized_symbol(sym)->set_symsize(data_size); // If the .got section is more than 0x8000 bytes, we add