aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-05-24 21:41:10 +0000
committerCary Coutant <ccoutant@google.com>2011-05-24 21:41:10 +0000
commit6fa2a40bf45fcc738eb580a6b644ac74b42c2d6a (patch)
tree41ae0a8dbe33a58e626c8fbcaa13f0b435b193bf /gold/object.cc
parent2e21250dbcb81b1909ba3fbda8931a47c7215beb (diff)
downloadgdb-6fa2a40bf45fcc738eb580a6b644ac74b42c2d6a.zip
gdb-6fa2a40bf45fcc738eb580a6b644ac74b42c2d6a.tar.gz
gdb-6fa2a40bf45fcc738eb580a6b644ac74b42c2d6a.tar.bz2
* incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
info; adjust display of GOT entries. * incremental.cc (Sized_incremental_binary::setup_readers): Allocate vector of input objects; remove file_status_. (Sized_incremental_binary::do_reserve_layout): Remove file_status_. (Sized_incremental_binary::do_process_got_plt): Adjust calls to got_plt reader; call target hooks to reserve GOT entries. (Output_section_incremental_inputs::set_final_data_size): Adjust size of input file info header and GOT info entry. (Output_section_incremental_inputs::write_info_blocks): Write dynamic relocation info. (Got_plt_view_info::got_descriptor): Remove. (Got_plt_view_info::sym_index): New data member. (Got_plt_view_info::input_index): New data member. (Local_got_offset_visitor::visit): Write input file index. (Global_got_offset_visitor::visit): Write 0 for input file index. (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor with sym_index and input_index. (Output_section_incremental_inputs::write_got_plt): Adjust size of incremental info GOT entry; replace got_descriptor with input_index. (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record map from input file index to object. (Sized_relobj_incr::do_layout): Replace direct data member reference with accessor function. (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class. * incremental.h (Incremental_input_entry_reader::get_symbol_offset): Adjust size of input file info header. (Incremental_input_entry_reader::get_first_dyn_reloc): New function. (Incremental_input_entry_reader::get_dyn_reloc_count): New function. (Incremental_input_entry_reader::get_input_section): Adjust size of input file info header. (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size of incremental info GOT entry. (Incremental_got_plt_reader::get_got_desc): Remove. (Incremental_got_plt_reader::get_got_symndx): New function. (Incremental_got_plt_reader::get_got_input_index): New function. (Sized_incremental_binary::Sized_incremental_binary): Remove file_status_; add input_objects_. (Sized_incremental_binary::~Sized_incremental_binary): Remove. (Sized_incremental_binary::set_file_is_unchanged): Remove. (Sized_incremental_binary::file_is_unchanged): Remove. (Sized_incremental_binary::set_input_object): New function. (Sized_incremental_binary::input_object): New function. (Sized_incremental_binary::file_status_): Remove. (Sized_incremental_binary::input_objects_): New data member. (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all references. (Sized_relobj_incr::invalid_address): Move to base class. (Sized_relobj_incr::is_output_section_offset_invalid): Move to base class. (Sized_relobj_incr::do_output_section_offset): Likewise. (Sized_relobj_incr::do_for_all_local_got_entries): Likewise. (Sized_relobj_incr::section_offsets_): Likewise. * object.cc (Sized_relobj::do_for_all_local_got_entries): New function. (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_. (Sized_relobj_file::layout_section): Replace refs to section_offsets_ with accessor function. (Sized_relobj_file::do_layout): Likewise. (Sized_relobj_file::do_layout_deferred_sections): Likewise. (Sized_relobj_file::do_for_all_local_got_entries): Move to base class. (Sized_relobj_file::compute_final_local_value): Replace refs to section_offsets_ with accessor function. (Sized_relobj_file::do_finalize_local_symbols): Likewise. * object.h (Relobj::Relobj): Initialize new data members. (Relobj::add_dyn_reloc): New function. (Relobj::first_dyn_reloc): New function. (Relobj::dyn_reloc_count): New function. (Relobj::first_dyn_reloc_): New data member. (Relobj::dyn_reloc_count_): New data member. (Sized_relobj): Rename Sized_relobj_base to this; adjust all references. (Sized_relobj::Address): New typedef. (Sized_relobj::invalid_address): Move here from child class. (Sized_relobj::Sized_relobj): Initialize new data members. (Sized_relobj::sized_relobj): New function. (Sized_relobj::is_output_section_offset_invalid): Move here from child class. (Sized_relobj::get_output_section_offset): Likewise. (Sized_relobj::local_has_got_offset): Likewise. (Sized_relobj::local_got_offset): Likewise. (Sized_relobj::set_local_got_offset): Likewise. (Sized_relobj::do_for_all_local_got_entries): Likewise. (Sized_relobj::clear_got_offsets): New function. (Sized_relobj::section_offsets): Move here from child class. (Sized_relobj::do_output_section_offset): Likewise. (Sized_relobj::do_set_section_offset): Likewise. (Sized_relobj::Local_got_offsets): Likewise. (Sized_relobj::local_got_offsets_): Likewise. (Sized_relobj::section_offsets_): Likewise. (Sized_relobj_file): Rename Sized_relobj to this; adjust all references. (Sized_relobj_file::is_output_section_offset_invalid): Move to base class. (Sized_relobj_file::sized_relobj): New function (Sized_relobj_file::local_has_got_offset): Move to base class. (Sized_relobj_file::local_got_offset): Likewise. (Sized_relobj_file::set_local_got_offset): Likewise. (Sized_relobj_file::get_output_section_offset): Likewise. (Sized_relobj_file::do_for_all_local_got_entries): Likewise. (Sized_relobj_file::do_output_section_offset): Likewise. (Sized_relobj_file::do_set_section_offset): Likewise. (Sized_relobj_file::Local_got_offsets): Likewise. (Sized_relobj_file::local_got_offsets_): Likewise. (Sized_relobj_file::section_offsets_): Likewise. * output.cc (Output_reloc::Output_reloc): Adjust type of relobj (all constructors). (set_needs_dynsym_index): Convert relobj to derived class pointer. (Output_reloc::get_symbol_index): Likewise. (Output_reloc::local_section_offset): Likewise. (Output_reloc::get_address): Likewise. (Output_reloc::symbol_value): Likewise. (Output_data_got::reserve_slot): Move to class definition. (Output_data_got::reserve_local): New function. (Output_data_got::reserve_slot_for_global): Remove. (Output_data_got::reserve_global): New function. * output.h (Output_reloc::Output_reloc): Adjust type of relobj (all constructors, two instantiations). (Output_reloc::get_relobj): New function (two instantiations). (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type. (Output_data_reloc_base::add): Convert relobj to derived class pointer. (Output_data_reloc::add_global): Adjust type of relobj. (Output_data_reloc::add_global_relative): Likewise. (Output_data_reloc::add_symbolless_global_addend): Likewise. (Output_data_reloc::add_local): Likewise. (Output_data_reloc::add_local_relative): Likewise. (Output_data_reloc::add_symbolless_local_addend): Likewise. (Output_data_reloc::add_local_section): Likewise. (Output_data_reloc::add_output_section): Likewise. (Output_data_reloc::add_absolute): Likewise. (Output_data_reloc::add_target_specific): Likewise. (Output_data_got::reserve_slot): Move definition here. (Output_data_got::reserve_local): New function. (Output_data_got::reserve_global): New function. * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to section_offsets_ with accessor function. (Sized_relobj_file::write_sections): Likewise. (Sized_relobj_file::do_relocate_sections): Likewise. * target.h (Sized_target::reserve_local_got_entry): New function. (Sized_target::reserve_global_got_entry): New function. * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function. (Target_x86_64::reserve_global_got_entry): New function. (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc187
1 files changed, 96 insertions, 91 deletions
diff --git a/gold/object.cc b/gold/object.cc
index a39a37c..1160f0c 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -189,7 +189,7 @@ Object::section_contents(unsigned int shndx, section_size_type* plen,
return this->get_view(loc.file_offset, *plen, true, cache);
}
-// Read the section data into SD. This is code common to Sized_relobj
+// Read the section data into SD. This is code common to Sized_relobj_file
// and Sized_dynobj, so we put it into Object.
template<int size, bool big_endian>
@@ -374,13 +374,35 @@ Relobj::finalize_incremental_relocs(Layout* layout, bool clear_counts)
// Class Sized_relobj.
+// Iterate over local symbols, calling a visitor class V for each GOT offset
+// associated with a local symbol.
+
template<int size, bool big_endian>
-Sized_relobj<size, big_endian>::Sized_relobj(
+void
+Sized_relobj<size, big_endian>::do_for_all_local_got_entries(
+ Got_offset_list::Visitor* v) const
+{
+ unsigned int nsyms = this->local_symbol_count();
+ for (unsigned int i = 0; i < nsyms; i++)
+ {
+ Local_got_offsets::const_iterator p = this->local_got_offsets_.find(i);
+ if (p != this->local_got_offsets_.end())
+ {
+ const Got_offset_list* got_offsets = p->second;
+ got_offsets->for_all_got_offsets(v);
+ }
+ }
+}
+
+// Class Sized_relobj_file.
+
+template<int size, bool big_endian>
+Sized_relobj_file<size, big_endian>::Sized_relobj_file(
const std::string& name,
Input_file* input_file,
off_t offset,
const elfcpp::Ehdr<size, big_endian>& ehdr)
- : Sized_relobj_base<size, big_endian>(name, input_file, offset),
+ : Sized_relobj<size, big_endian>(name, input_file, offset),
elf_file_(this, ehdr),
symtab_shndx_(-1U),
local_symbol_count_(0),
@@ -391,7 +413,6 @@ Sized_relobj<size, big_endian>::Sized_relobj(
local_symbol_offset_(0),
local_dynsym_offset_(0),
local_values_(),
- local_got_offsets_(),
local_plt_offsets_(),
kept_comdat_sections_(),
has_eh_frame_(false),
@@ -403,7 +424,7 @@ Sized_relobj<size, big_endian>::Sized_relobj(
}
template<int size, bool big_endian>
-Sized_relobj<size, big_endian>::~Sized_relobj()
+Sized_relobj_file<size, big_endian>::~Sized_relobj_file()
{
}
@@ -412,7 +433,7 @@ Sized_relobj<size, big_endian>::~Sized_relobj()
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_setup()
+Sized_relobj_file<size, big_endian>::do_setup()
{
const unsigned int shnum = this->elf_file_.shnum();
this->set_shnum(shnum);
@@ -425,7 +446,7 @@ Sized_relobj<size, big_endian>::do_setup()
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::find_symtab(const unsigned char* pshdrs)
+Sized_relobj_file<size, big_endian>::find_symtab(const unsigned char* pshdrs)
{
const unsigned int shnum = this->shnum();
this->symtab_shndx_ = 0;
@@ -474,7 +495,7 @@ Sized_relobj<size, big_endian>::find_symtab(const unsigned char* pshdrs)
template<int size, bool big_endian>
Xindex*
-Sized_relobj<size, big_endian>::do_initialize_xindex()
+Sized_relobj_file<size, big_endian>::do_initialize_xindex()
{
gold_assert(this->symtab_shndx_ != -1U);
Xindex* xindex = new Xindex(this->elf_file_.large_shndx_offset());
@@ -487,7 +508,7 @@ Sized_relobj<size, big_endian>::do_initialize_xindex()
template<int size, bool big_endian>
bool
-Sized_relobj<size, big_endian>::check_eh_frame_flags(
+Sized_relobj_file<size, big_endian>::check_eh_frame_flags(
const elfcpp::Shdr<size, big_endian>* shdr) const
{
return (shdr->get_sh_type() == elfcpp::SHT_PROGBITS
@@ -499,7 +520,7 @@ Sized_relobj<size, big_endian>::check_eh_frame_flags(
template<int size, bool big_endian>
bool
-Sized_relobj<size, big_endian>::find_eh_frame(
+Sized_relobj_file<size, big_endian>::find_eh_frame(
const unsigned char* pshdrs,
const char* names,
section_size_type names_size) const
@@ -536,7 +557,7 @@ build_compressed_section_map(
unsigned int shnum,
const char* names,
section_size_type names_size,
- Sized_relobj<size, big_endian>* obj)
+ Sized_relobj_file<size, big_endian>* obj)
{
Compressed_section_map* uncompressed_sizes = new Compressed_section_map();
const unsigned int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
@@ -574,7 +595,7 @@ build_compressed_section_map(
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
+Sized_relobj_file<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
{
this->read_section_data(&this->elf_file_, sd);
@@ -677,9 +698,9 @@ Sized_relobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
template<int size, bool big_endian>
unsigned int
-Sized_relobj<size, big_endian>::symbol_section_and_value(unsigned int sym,
- Address* value,
- bool* is_ordinary)
+Sized_relobj_file<size, big_endian>::symbol_section_and_value(unsigned int sym,
+ Address* value,
+ bool* is_ordinary)
{
section_size_type symbols_size;
const unsigned char* symbols = this->section_contents(this->symtab_shndx_,
@@ -703,7 +724,7 @@ Sized_relobj<size, big_endian>::symbol_section_and_value(unsigned int sym,
template<int size, bool big_endian>
bool
-Sized_relobj<size, big_endian>::include_section_group(
+Sized_relobj_file<size, big_endian>::include_section_group(
Symbol_table* symtab,
Layout* layout,
unsigned int index,
@@ -916,7 +937,7 @@ Sized_relobj<size, big_endian>::include_section_group(
template<int size, bool big_endian>
bool
-Sized_relobj<size, big_endian>::include_linkonce_section(
+Sized_relobj_file<size, big_endian>::include_linkonce_section(
Layout* layout,
unsigned int index,
const char* name,
@@ -988,12 +1009,12 @@ Sized_relobj<size, big_endian>::include_linkonce_section(
template<int size, bool big_endian>
inline void
-Sized_relobj<size, big_endian>::layout_section(Layout* layout,
- unsigned int shndx,
- const char* name,
- typename This::Shdr& shdr,
- unsigned int reloc_shndx,
- unsigned int reloc_type)
+Sized_relobj_file<size, big_endian>::layout_section(Layout* layout,
+ unsigned int shndx,
+ const char* name,
+ typename This::Shdr& shdr,
+ unsigned int reloc_shndx,
+ unsigned int reloc_type)
{
off_t offset;
Output_section* os = layout->layout(this, shndx, name, shdr,
@@ -1001,9 +1022,9 @@ Sized_relobj<size, big_endian>::layout_section(Layout* layout,
this->output_sections()[shndx] = os;
if (offset == -1)
- this->section_offsets_[shndx] = invalid_address;
+ this->section_offsets()[shndx] = invalid_address;
else
- this->section_offsets_[shndx] = convert_types<Address, off_t>(offset);
+ this->section_offsets()[shndx] = convert_types<Address, off_t>(offset);
// If this section requires special handling, and if there are
// relocs that apply to it, then we must do the special handling
@@ -1028,9 +1049,9 @@ Sized_relobj<size, big_endian>::layout_section(Layout* layout,
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
- Layout* layout,
- Read_symbols_data* sd)
+Sized_relobj_file<size, big_endian>::do_layout(Symbol_table* symtab,
+ Layout* layout,
+ Read_symbols_data* sd)
{
const unsigned int shnum = this->shnum();
bool is_gc_pass_one = ((parameters->options().gc_sections()
@@ -1151,7 +1172,7 @@ Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
}
Output_sections& out_sections(this->output_sections());
- std::vector<Address>& out_section_offsets(this->section_offsets_);
+ std::vector<Address>& out_section_offsets(this->section_offsets());
if (!is_gc_pass_two)
{
@@ -1552,7 +1573,7 @@ Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_layout_deferred_sections(Layout* layout)
+Sized_relobj_file<size, big_endian>::do_layout_deferred_sections(Layout* layout)
{
typename std::vector<Deferred_layout>::iterator deferred;
@@ -1575,7 +1596,7 @@ Sized_relobj<size, big_endian>::do_layout_deferred_sections(Layout* layout)
// Now handle the deferred relocation sections.
Output_sections& out_sections(this->output_sections());
- std::vector<Address>& out_section_offsets(this->section_offsets_);
+ std::vector<Address>& out_section_offsets(this->section_offsets());
for (deferred = this->deferred_layout_relocs_.begin();
deferred != this->deferred_layout_relocs_.end();
@@ -1607,9 +1628,9 @@ Sized_relobj<size, big_endian>::do_layout_deferred_sections(Layout* layout)
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_add_symbols(Symbol_table* symtab,
- Read_symbols_data* sd,
- Layout*)
+Sized_relobj_file<size, big_endian>::do_add_symbols(Symbol_table* symtab,
+ Read_symbols_data* sd,
+ Layout*)
{
if (sd->symbols == NULL)
{
@@ -1650,10 +1671,11 @@ Sized_relobj<size, big_endian>::do_add_symbols(Symbol_table* symtab,
template<int size, bool big_endian>
Archive::Should_include
-Sized_relobj<size, big_endian>::do_should_include_member(Symbol_table* symtab,
- Layout* layout,
- Read_symbols_data* sd,
- std::string* why)
+Sized_relobj_file<size, big_endian>::do_should_include_member(
+ Symbol_table* symtab,
+ Layout* layout,
+ Read_symbols_data* sd,
+ std::string* why)
{
char* tmpbuf = NULL;
size_t tmpbuflen = 0;
@@ -1699,7 +1721,7 @@ Sized_relobj<size, big_endian>::do_should_include_member(Symbol_table* symtab,
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_for_all_global_symbols(
+Sized_relobj_file<size, big_endian>::do_for_all_global_symbols(
Read_symbols_data* sd,
Library_base::Symbol_visitor_base* v)
{
@@ -1720,31 +1742,12 @@ Sized_relobj<size, big_endian>::do_for_all_global_symbols(
}
}
-// Iterate over local symbols, calling a visitor class V for each GOT offset
-// associated with a local symbol.
-
-template<int size, bool big_endian>
-void
-Sized_relobj<size, big_endian>::do_for_all_local_got_entries(
- Got_offset_list::Visitor* v) const
-{
- unsigned int nsyms = this->local_symbol_count();
- for (unsigned int i = 0; i < nsyms; i++)
- {
- Local_got_offsets::const_iterator p = this->local_got_offsets_.find(i);
- if (p != this->local_got_offsets_.end())
- {
- const Got_offset_list* got_offsets = p->second;
- got_offsets->for_all_got_offsets(v);
- }
- }
-}
-
// Return whether the local symbol SYMNDX has a PLT offset.
template<int size, bool big_endian>
bool
-Sized_relobj<size, big_endian>::local_has_plt_offset(unsigned int symndx) const
+Sized_relobj_file<size, big_endian>::local_has_plt_offset(
+ unsigned int symndx) const
{
typename Local_plt_offsets::const_iterator p =
this->local_plt_offsets_.find(symndx);
@@ -1755,7 +1758,7 @@ Sized_relobj<size, big_endian>::local_has_plt_offset(unsigned int symndx) const
template<int size, bool big_endian>
unsigned int
-Sized_relobj<size, big_endian>::local_plt_offset(unsigned int symndx) const
+Sized_relobj_file<size, big_endian>::local_plt_offset(unsigned int symndx) const
{
typename Local_plt_offsets::const_iterator p =
this->local_plt_offsets_.find(symndx);
@@ -1767,8 +1770,8 @@ Sized_relobj<size, big_endian>::local_plt_offset(unsigned int symndx) const
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::set_local_plt_offset(unsigned int symndx,
- unsigned int plt_offset)
+Sized_relobj_file<size, big_endian>::set_local_plt_offset(
+ unsigned int symndx, unsigned int plt_offset)
{
std::pair<typename Local_plt_offsets::iterator, bool> ins =
this->local_plt_offsets_.insert(std::make_pair(symndx, plt_offset));
@@ -1783,8 +1786,8 @@ Sized_relobj<size, big_endian>::set_local_plt_offset(unsigned int symndx,
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_count_local_symbols(Stringpool* pool,
- Stringpool* dynpool)
+Sized_relobj_file<size, big_endian>::do_count_local_symbols(Stringpool* pool,
+ Stringpool* dynpool)
{
gold_assert(this->symtab_shndx_ != -1U);
if (this->symtab_shndx_ == 0)
@@ -1932,8 +1935,8 @@ Sized_relobj<size, big_endian>::do_count_local_symbols(Stringpool* pool,
// Compute the final value of a local symbol.
template<int size, bool big_endian>
-typename Sized_relobj<size, big_endian>::Compute_final_local_value_status
-Sized_relobj<size, big_endian>::compute_final_local_value_internal(
+typename Sized_relobj_file<size, big_endian>::Compute_final_local_value_status
+Sized_relobj_file<size, big_endian>::compute_final_local_value_internal(
unsigned int r_sym,
const Symbol_value<size>* lv_in,
Symbol_value<size>* lv_out,
@@ -1982,8 +1985,8 @@ Sized_relobj<size, big_endian>::compute_final_local_value_internal(
Section_id folded = symtab->icf()->get_folded_section(this,
shndx);
gold_assert(folded.first != NULL);
- Sized_relobj<size, big_endian>* folded_obj = reinterpret_cast
- <Sized_relobj<size, big_endian>*>(folded.first);
+ Sized_relobj_file<size, big_endian>* folded_obj = reinterpret_cast
+ <Sized_relobj_file<size, big_endian>*>(folded.first);
os = folded_obj->output_section(folded.second);
gold_assert(os != NULL);
secoffset = folded_obj->get_output_section_offset(folded.second);
@@ -2085,8 +2088,8 @@ Sized_relobj<size, big_endian>::compute_final_local_value_internal(
// everything is finalized. The caller should also free up any allocated
// memory in the return value in *LV.
template<int size, bool big_endian>
-typename Sized_relobj<size, big_endian>::Compute_final_local_value_status
-Sized_relobj<size, big_endian>::compute_final_local_value(
+typename Sized_relobj_file<size, big_endian>::Compute_final_local_value_status
+Sized_relobj_file<size, big_endian>::compute_final_local_value(
unsigned int r_sym,
const Symbol_value<size>* lv_in,
Symbol_value<size>* lv_out,
@@ -2095,7 +2098,7 @@ Sized_relobj<size, big_endian>::compute_final_local_value(
// This is just a wrapper of compute_final_local_value_internal.
const bool relocatable = parameters->options().relocatable();
const Output_sections& out_sections(this->output_sections());
- const std::vector<Address>& out_offsets(this->section_offsets_);
+ const std::vector<Address>& out_offsets(this->section_offsets());
return this->compute_final_local_value_internal(r_sym, lv_in, lv_out,
relocatable, out_sections,
out_offsets, symtab);
@@ -2108,9 +2111,10 @@ Sized_relobj<size, big_endian>::compute_final_local_value(
template<int size, bool big_endian>
unsigned int
-Sized_relobj<size, big_endian>::do_finalize_local_symbols(unsigned int index,
- off_t off,
- Symbol_table* symtab)
+Sized_relobj_file<size, big_endian>::do_finalize_local_symbols(
+ unsigned int index,
+ off_t off,
+ Symbol_table* symtab)
{
gold_assert(off == static_cast<off_t>(align_address(off, size >> 3)));
@@ -2119,7 +2123,7 @@ Sized_relobj<size, big_endian>::do_finalize_local_symbols(unsigned int index,
const bool relocatable = parameters->options().relocatable();
const Output_sections& out_sections(this->output_sections());
- const std::vector<Address>& out_offsets(this->section_offsets_);
+ const std::vector<Address>& out_offsets(this->section_offsets());
for (unsigned int i = 1; i < loccount; ++i)
{
@@ -2153,7 +2157,8 @@ Sized_relobj<size, big_endian>::do_finalize_local_symbols(unsigned int index,
template<int size, bool big_endian>
unsigned int
-Sized_relobj<size, big_endian>::do_set_local_dynsym_indexes(unsigned int index)
+Sized_relobj_file<size, big_endian>::do_set_local_dynsym_indexes(
+ unsigned int index)
{
const unsigned int loccount = this->local_symbol_count_;
for (unsigned int i = 1; i < loccount; ++i)
@@ -2174,7 +2179,7 @@ Sized_relobj<size, big_endian>::do_set_local_dynsym_indexes(unsigned int index)
template<int size, bool big_endian>
unsigned int
-Sized_relobj<size, big_endian>::do_set_local_dynsym_offset(off_t off)
+Sized_relobj_file<size, big_endian>::do_set_local_dynsym_offset(off_t off)
{
gold_assert(off == static_cast<off_t>(align_address(off, size >> 3)));
this->local_dynsym_offset_ = off;
@@ -2186,7 +2191,7 @@ Sized_relobj<size, big_endian>::do_set_local_dynsym_offset(off_t off)
template<int size, bool big_endian>
uint64_t
-Sized_relobj<size, big_endian>::do_section_flags(unsigned int shndx)
+Sized_relobj_file<size, big_endian>::do_section_flags(unsigned int shndx)
{
Symbols_data* sd = this->get_symbols_data();
if (sd != NULL)
@@ -2205,7 +2210,7 @@ Sized_relobj<size, big_endian>::do_section_flags(unsigned int shndx)
template<int size, bool big_endian>
uint64_t
-Sized_relobj<size, big_endian>::do_section_entsize(unsigned int shndx)
+Sized_relobj_file<size, big_endian>::do_section_entsize(unsigned int shndx)
{
Symbols_data* sd = this->get_symbols_data();
gold_assert(sd != NULL);
@@ -2220,7 +2225,7 @@ Sized_relobj<size, big_endian>::do_section_entsize(unsigned int shndx)
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::write_local_symbols(
+Sized_relobj_file<size, big_endian>::write_local_symbols(
Output_file* of,
const Stringpool* sympool,
const Stringpool* dynpool,
@@ -2370,7 +2375,7 @@ Sized_relobj<size, big_endian>::write_local_symbols(
template<int size, bool big_endian>
bool
-Sized_relobj<size, big_endian>::get_symbol_location_info(
+Sized_relobj_file<size, big_endian>::get_symbol_location_info(
unsigned int shndx,
off_t offset,
Symbol_location_info* info)
@@ -2445,8 +2450,8 @@ Sized_relobj<size, big_endian>::get_symbol_location_info(
// debugging sections. If we can't find the kept section, return 0.
template<int size, bool big_endian>
-typename Sized_relobj<size, big_endian>::Address
-Sized_relobj<size, big_endian>::map_to_kept_section(
+typename Sized_relobj_file<size, big_endian>::Address
+Sized_relobj_file<size, big_endian>::map_to_kept_section(
unsigned int shndx,
bool* found) const
{
@@ -2454,8 +2459,8 @@ Sized_relobj<size, big_endian>::map_to_kept_section(
unsigned int kept_shndx;
if (this->get_kept_comdat_section(shndx, &kept_object, &kept_shndx))
{
- Sized_relobj<size, big_endian>* kept_relobj =
- static_cast<Sized_relobj<size, big_endian>*>(kept_object);
+ Sized_relobj_file<size, big_endian>* kept_relobj =
+ static_cast<Sized_relobj_file<size, big_endian>*>(kept_object);
Output_section* os = kept_relobj->output_section(kept_shndx);
Address offset = kept_relobj->get_output_section_offset(kept_shndx);
if (os != NULL && offset != invalid_address)
@@ -2472,7 +2477,7 @@ Sized_relobj<size, big_endian>::map_to_kept_section(
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_get_global_symbol_counts(
+Sized_relobj_file<size, big_endian>::do_get_global_symbol_counts(
const Symbol_table*,
size_t* defined,
size_t* used) const
@@ -2851,22 +2856,22 @@ Object::read_section_data<64, true>(elfcpp::Elf_file<64, true, Object>*,
#ifdef HAVE_TARGET_32_LITTLE
template
-class Sized_relobj<32, false>;
+class Sized_relobj_file<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
-class Sized_relobj<32, true>;
+class Sized_relobj_file<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
-class Sized_relobj<64, false>;
+class Sized_relobj_file<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
-class Sized_relobj<64, true>;
+class Sized_relobj_file<64, true>;
#endif
#ifdef HAVE_TARGET_32_LITTLE