diff options
author | Alan Modra <amodra@gmail.com> | 2012-08-30 05:54:59 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-08-30 05:54:59 +0000 |
commit | 703d02da7640f756751a5cd94961127d68efcd22 (patch) | |
tree | ac1cdd7ec05f193f7c5740c4561f569c8d3e87e4 /gold/output.cc | |
parent | 37580ec21c32fe7681d4af29a3b218602c49c9b7 (diff) | |
download | gdb-703d02da7640f756751a5cd94961127d68efcd22.zip gdb-703d02da7640f756751a5cd94961127d68efcd22.tar.gz gdb-703d02da7640f756751a5cd94961127d68efcd22.tar.bz2 |
* 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.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gold/output.cc b/gold/output.cc index 2539aac..68fe573 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_); |