+2014-07-08 Cary Coutant <ccoutant@google.com>
+
+ PR gold/15639
+ * dynobj.h (Sized_dynobj::base_read_symbols): New method.
+ * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
+ (Sized_dynobj::base_read_symbols): ...new method.
+ * object.h (Sized_relobj_file::base_read_symbols): New method.
+ * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
+ (Sized_relobj_file::base_read_symbols): ...new method.
+ * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
+ * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
+ * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
+
2014-07-04 Alan Modra <amodra@gmail.com>
* po/POTFILES.in: Regenerate.
Arm_relobj<big_endian>::do_read_symbols(Read_symbols_data* sd)
{
// Call parent class to read symbol information.
- Sized_relobj_file<32, big_endian>::do_read_symbols(sd);
+ this->base_read_symbols(sd);
// If this input file is a binary file, it has no processor
// specific flags and attributes section.
Arm_dynobj<big_endian>::do_read_symbols(Read_symbols_data* sd)
{
// Call parent class to read symbol information.
- Sized_dynobj<32, big_endian>::do_read_symbols(sd);
+ this->base_read_symbols(sd);
// Read processor-specific flags in ELF file header.
const unsigned char* pehdr = this->get_view(elfcpp::file_header_offset,
template<int size, bool big_endian>
void
Sized_dynobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
+{
+ this->base_read_symbols(sd);
+}
+
+// Read the symbols and sections from a dynamic object. We read the
+// dynamic symbols, not the normal symbols. This is common code for
+// all target-specific overrides of do_read_symbols().
+
+template<int size, bool big_endian>
+void
+Sized_dynobj<size, big_endian>::base_read_symbols(Read_symbols_data* sd)
{
this->read_section_data(&this->elf_file_, sd);
do_get_global_symbols() const
{ return this->symbols_; }
+ protected:
+ // Read the symbols. This is common code for all target-specific
+ // overrides of do_read_symbols().
+ void
+ base_read_symbols(Read_symbols_data*);
+
private:
// For convenience.
typedef Sized_dynobj<size, big_endian> This;
Mips_relobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
{
// Call parent class to read symbol information.
- Sized_relobj_file<size, big_endian>::do_read_symbols(sd);
+ this->base_read_symbols(sd);
// Read processor-specific flags in ELF file header.
const unsigned char* pehdr = this->get_view(elfcpp::file_header_offset,
template<int size, bool big_endian>
void
Sized_relobj_file<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
+{
+ this->base_read_symbols(sd);
+}
+
+// Read the sections and symbols from an object file. This is common
+// code for all target-specific overrides of do_read_symbols().
+
+template<int size, bool big_endian>
+void
+Sized_relobj_file<size, big_endian>::base_read_symbols(Read_symbols_data* sd)
{
this->read_section_data(&this->elf_file_, sd);
// Reading the symbols again here may be slow.
Read_symbols_data sd;
- this->read_symbols(&sd);
+ this->base_read_symbols(&sd);
this->layout_eh_frame_section(layout,
sd.symbols->data(),
sd.symbols_size,
void
do_read_symbols(Read_symbols_data*);
+ // Read the symbols. This is common code for all target-specific
+ // overrides of do_read_symbols.
+ void
+ base_read_symbols(Read_symbols_data*);
+
// Return the value of a local symbol.
uint64_t
do_local_symbol_value(unsigned int symndx, uint64_t addend) const
void
Powerpc_relobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
{
- Sized_relobj_file<size, big_endian>::do_read_symbols(sd);
+ this->base_read_symbols(sd);
if (size == 64)
{
const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
}
}
-// Call Sized_dynobj::do_read_symbols to read the symbols then
+// Call Sized_dynobj::base_read_symbols to read the symbols then
// read .opd from a dynamic object, filling in opd_ent_ vector,
template<int size, bool big_endian>
void
Powerpc_dynobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
{
- Sized_dynobj<size, big_endian>::do_read_symbols(sd);
+ this->base_read_symbols(sd);
if (size == 64)
{
const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;