From 9fc236f3fd33165d017dee94798ed08db95e87a0 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Tue, 23 Oct 2012 21:34:58 +0000 Subject: gold/ * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness from object, not parameters. (Dwarf_info_reader::parse): Likewise. * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods. (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods. (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New methods. --- gold/object.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gold/object.h') diff --git a/gold/object.h b/gold/object.h index 522b63f..01c3c6f 100644 --- a/gold/object.h +++ b/gold/object.h @@ -1224,6 +1224,16 @@ class Relobj : public Object do_get_incremental_reloc_count(unsigned int symndx) const { return this->reloc_counts_[symndx]; } + // Return the word size of the object file. + int + elfsize() const + { return this->do_elfsize(); } + + // Return TRUE if this is a big-endian object file. + bool + is_big_endian() const + { return this->do_is_big_endian(); } + protected: // The output section to be used for each input section, indexed by // the input section number. The output section is NULL if the @@ -1386,6 +1396,16 @@ class Relobj : public Object return this->reloc_bases_[symndx] + counter; } + // Return the word size of the object file-- + // implemented by child class. + virtual int + do_elfsize() const = 0; + + // Return TRUE if this is a big-endian object file-- + // implemented by child class. + virtual bool + do_is_big_endian() const = 0; + private: // Mapping from input sections to output section. Output_sections output_sections_; @@ -1963,6 +1983,16 @@ class Sized_relobj : public Relobj } } + // Return the word size of the object file. + virtual int + do_elfsize() const + { return size; } + + // Return TRUE if this is a big-endian object file. + virtual bool + do_is_big_endian() const + { return big_endian; } + private: // The GOT offsets of local symbols. This map also stores GOT offsets // for tp-relative offsets for TLS symbols. -- cgit v1.1