summaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-10-05 00:45:54 +0000
committerAlan Modra <amodra@gmail.com>2012-10-05 00:45:54 +0000
commit19fec8c1d313c6757a53dc7f09776dc9770ee2ef (patch)
treee330d3c2414ede0d1e0b37e4bb238811cc6c11e3 /gold/output.cc
parentfda1189bbcdf6b9c384bf5befee3e3ff6e647711 (diff)
* i386.cc (Output_data_plt_i386::address_for_global,
address_for_local): Add plt offset to returned value. Adjust uses. * sparc.cc (Output_data_plt_sparc::address_for_global, address_for_local): Likewise. * tilegx.cc (Output_data_plt_tilegx::address_for_global, address_for_local): Likewise. * x86_64.cc (Output_data_plt_x86_64::address_for_global, address_for_local): Likewise. * target.h (Target::plt_address_for_global, plt_address_for_local): Update comment. * output.cc (Output_reloc::symbol_value): Don't add plt offset here. (Output_data_got::Got_entry::write): Nor here. * output.h: Comment fix.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc25
1 files changed, 6 insertions, 19 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 96fdd9fa81..6e5cd2510a 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -1129,11 +1129,7 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::symbol_value(
const Sized_symbol<size>* sym;
sym = static_cast<const Sized_symbol<size>*>(this->u1_.gsym);
if (this->use_plt_offset_ && sym->has_plt_offset())
- {
- uint64_t plt_address =
- parameters->target().plt_address_for_global(sym);
- return plt_address + sym->plt_offset();
- }
+ return parameters->target().plt_address_for_global(sym);
else
return sym->value() + addend;
}
@@ -1151,11 +1147,7 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::symbol_value(
this->u1_.relobj->sized_relobj();
gold_assert(relobj != NULL);
if (this->use_plt_offset_)
- {
- uint64_t plt_address =
- parameters->target().plt_address_for_local(relobj, lsi);
- return plt_address + relobj->local_plt_offset(lsi);
- }
+ return parameters->target().plt_address_for_local(relobj, lsi);
const Symbol_value<size>* symval = relobj->local_symbol(lsi);
return symval->value(relobj, addend);
}
@@ -1385,8 +1377,7 @@ Output_data_got<got_size, big_endian>::Got_entry::write(
// RELATIVE relocation.
Symbol* gsym = this->u_.gsym;
if (this->use_plt_or_tls_offset_ && gsym->has_plt_offset())
- val = (parameters->target().plt_address_for_global(gsym)
- + gsym->plt_offset());
+ val = parameters->target().plt_address_for_global(gsym);
else
{
switch (parameters->size_and_endianness())
@@ -1442,11 +1433,7 @@ Output_data_got<got_size, big_endian>::Got_entry::write(
const unsigned int lsi = this->local_sym_index_;
bool is_tls = object->local_is_tls(lsi);
if (this->use_plt_or_tls_offset_ && !is_tls)
- {
- uint64_t plt_address =
- parameters->target().plt_address_for_local(object, lsi);
- val = plt_address + object->local_plt_offset(lsi);
- }
+ val = parameters->target().plt_address_for_local(object, lsi);
else
{
uint64_t lval = object->local_symbol_value(lsi, 0);
@@ -2609,9 +2596,9 @@ Output_section::add_relaxed_input_section(Layout* layout,
// For a relaxed section, we use the current data size. Linker scripts
// get all the input sections, including relaxed one from an output
- // section and add them back to them same output section to compute the
+ // section and add them back to the same output section to compute the
// output section size. If we do not account for sizes of relaxed input
- // sections, an output section would be incorrectly sized.
+ // sections, an output section would be incorrectly sized.
off_t offset_in_section = this->current_data_size_for_child();
off_t aligned_offset_in_section = align_address(offset_in_section,
poris->addralign());