diff options
Diffstat (limited to 'gold/tilegx.cc')
-rw-r--r-- | gold/tilegx.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gold/tilegx.cc b/gold/tilegx.cc index a209a97..3c61802 100644 --- a/gold/tilegx.cc +++ b/gold/tilegx.cc @@ -2194,7 +2194,7 @@ Output_data_plt_tilegx<size, big_endian>::address_for_global( if (gsym->type() == elfcpp::STT_GNU_IFUNC && gsym->can_use_relative_reloc(false)) offset = (this->count_ + 1) * this->get_plt_entry_size(); - return this->address() + offset; + return this->address() + offset + gsym->plt_offset(); } // Return the PLT address to use for a local symbol. These are always @@ -2202,10 +2202,13 @@ Output_data_plt_tilegx<size, big_endian>::address_for_global( template<int size, bool big_endian> uint64_t -Output_data_plt_tilegx<size, big_endian>::address_for_local(const Relobj*, - unsigned int) +Output_data_plt_tilegx<size, big_endian>::address_for_local( + const Relobj* object, + unsigned int r_sym) { - return this->address() + (this->count_ + 1) * this->get_plt_entry_size(); + return (this->address() + + (this->count_ + 1) * this->get_plt_entry_size() + + object->local_plt_offset(r_sym)); } // Set the final size. @@ -4334,8 +4337,7 @@ Target_tilegx<size, big_endian>::Relocate::relocate( if (gsym != NULL && gsym->use_plt_offset(Scan::get_reference_flags(r_type))) { - symval.set_output_value(target->plt_address_for_global(gsym) - + gsym->plt_offset()); + symval.set_output_value(target->plt_address_for_global(gsym)); psymval = &symval; } else if (gsym == NULL && psymval->is_ifunc_symbol()) @@ -4343,8 +4345,7 @@ Target_tilegx<size, big_endian>::Relocate::relocate( unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info()); if (object->local_has_plt_offset(r_sym)) { - symval.set_output_value(target->plt_address_for_local(object, r_sym) - + object->local_plt_offset(r_sym)); + symval.set_output_value(target->plt_address_for_local(object, r_sym)); psymval = &symval; } } @@ -4557,8 +4558,7 @@ Target_tilegx<size, big_endian>::Relocate::relocate( if (opt_t == tls::TLSOPT_NONE) { Symbol *tls_sym = relinfo->symtab->lookup("__tls_get_addr"); symval.set_output_value( - target->plt_address_for_global(tls_sym) - + tls_sym->plt_offset()); + target->plt_address_for_global(tls_sym)); psymval = &symval; TilegxReloc::imm_x_pcrel_general(view, object, psymval, addend, address, r_howto); @@ -4870,7 +4870,7 @@ uint64_t Target_tilegx<size, big_endian>::do_dynsym_value(const Symbol* gsym) const { gold_assert(gsym->is_from_dynobj() && gsym->has_plt_offset()); - return this->plt_address_for_global(gsym) + gsym->plt_offset(); + return this->plt_address_for_global(gsym); } // Return the value to use for the base of a DW_EH_PE_datarel offset |