summaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-08-30 05:54:59 +0000
committerAlan Modra <amodra@gmail.com>2012-08-30 05:54:59 +0000
commit703d02da7640f756751a5cd94961127d68efcd22 (patch)
treeac1cdd7ec05f193f7c5740c4561f569c8d3e87e4 /gold/output.cc
parent37580ec21c32fe7681d4af29a3b218602c49c9b7 (diff)
* output.h (Output_reloc::Output_reloc <output section>): Add
is_relative param. Adjust calls. (Output_reloc::add_output_section_relative): New functions. * output.cc (Output_reloc::Output_reloc <output section>): Handle is_relative. (Output_reloc::symbol_value): Handle SECTION_CODE.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 2539aac8a6..68fe573f86 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -811,9 +811,10 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
Output_section* os,
unsigned int type,
Output_data* od,
- Address address)
+ Address address,
+ bool is_relative)
: address_(address), local_sym_index_(SECTION_CODE), type_(type),
- is_relative_(false), is_symbolless_(false),
+ is_relative_(is_relative), is_symbolless_(is_relative),
is_section_symbol_(true), use_plt_offset_(false), shndx_(INVALID_CODE)
{
// this->type_ is a bitfield; make sure TYPE fits.
@@ -832,9 +833,10 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
unsigned int type,
Sized_relobj<size, big_endian>* relobj,
unsigned int shndx,
- Address address)
+ Address address,
+ bool is_relative)
: address_(address), local_sym_index_(SECTION_CODE), type_(type),
- is_relative_(false), is_symbolless_(false),
+ is_relative_(is_relative), is_symbolless_(is_relative),
is_section_symbol_(true), use_plt_offset_(false), shndx_(shndx)
{
gold_assert(shndx != INVALID_CODE);
@@ -1134,8 +1136,12 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::symbol_value(
else
return sym->value() + addend;
}
- gold_assert(this->local_sym_index_ != SECTION_CODE
- && this->local_sym_index_ != TARGET_CODE
+ if (this->local_sym_index_ == SECTION_CODE)
+ {
+ gold_assert(!this->use_plt_offset_);
+ return this->u1_.os->address() + addend;
+ }
+ gold_assert(this->local_sym_index_ != TARGET_CODE
&& this->local_sym_index_ != INVALID_CODE
&& this->local_sym_index_ != 0
&& !this->is_section_symbol_);