summaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-03-10 23:08:18 +0000
committerAlan Modra <amodra@gmail.com>2013-03-10 23:08:18 +0000
commitdc3714f31f5b15f9c078dcf7ddaa705dacd313c0 (patch)
tree29717f9ed43f8fa606369975acac03a8e719c056 /gold/object.cc
parent3bcc5422890014bfa8f8602d3c680c29a3384c29 (diff)
* gold.cc (queue_middle_tasks): Move detect_odr_violations..
* layout.cc (Layout_task_runner::run): ..to here. * symtab.h (struct Symbol_location): Extract from.. (class Symbol_table): ..here. * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location. * target.h (class Target): Add function_location and do_function_location functions. (class Sized_target): Add do_function_location. * object.h (class Sized_relobj_file): Move find_shdr.. (class Object): ..to here. * object.cc: Likewise. Update to suit. Instantiate. (Sized_relobj_file::find_eh_frame): Update find_shdr call. * powerpc.cc (class Powerpc_dynobj): New. (Target_powerpc::do_function_location): New function. (Powerpc_relobj::do_find_special_sections): Update find_shdr call. (Powerpc_dynobj::do_read_symbols): New function. (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc32
1 files changed, 25 insertions, 7 deletions
diff --git a/gold/object.cc b/gold/object.cc
index 3a4f9f8c70..34343031f8 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -517,15 +517,16 @@ Sized_relobj_file<size, big_endian>::check_eh_frame_flags(
template<int size, bool big_endian>
const unsigned char*
-Sized_relobj_file<size, big_endian>::find_shdr(
+Object::find_shdr(
const unsigned char* pshdrs,
const char* name,
const char* names,
section_size_type names_size,
const unsigned char* hdr) const
{
+ const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
const unsigned int shnum = this->shnum();
- const unsigned char* hdr_end = pshdrs + This::shdr_size * shnum;
+ const unsigned char* hdr_end = pshdrs + shdr_size * shnum;
size_t sh_name = 0;
while (1)
@@ -533,7 +534,7 @@ Sized_relobj_file<size, big_endian>::find_shdr(
if (hdr)
{
// We found HDR last time we were called, continue looking.
- typename This::Shdr shdr(hdr);
+ typename elfcpp::Shdr<size, big_endian> shdr(hdr);
sh_name = shdr.get_sh_name();
}
else
@@ -557,13 +558,13 @@ Sized_relobj_file<size, big_endian>::find_shdr(
return hdr;
}
- hdr += This::shdr_size;
+ hdr += shdr_size;
while (hdr < hdr_end)
{
- typename This::Shdr shdr(hdr);
+ typename elfcpp::Shdr<size, big_endian> shdr(hdr);
if (shdr.get_sh_name() == sh_name)
return hdr;
- hdr += This::shdr_size;
+ hdr += shdr_size;
}
hdr = NULL;
if (sh_name == 0)
@@ -585,7 +586,8 @@ Sized_relobj_file<size, big_endian>::find_eh_frame(
while (1)
{
- s = this->find_shdr(pshdrs, ".eh_frame", names, names_size, s);
+ s = this->template find_shdr<size, big_endian>(pshdrs, ".eh_frame",
+ names, names_size, s);
if (s == NULL)
return false;
@@ -3163,6 +3165,10 @@ template
void
Object::read_section_data<32, false>(elfcpp::Elf_file<32, false, Object>*,
Read_symbols_data*);
+template
+const unsigned char*
+Object::find_shdr<32,false>(const unsigned char*, const char*, const char*,
+ section_size_type, const unsigned char*) const;
#endif
#ifdef HAVE_TARGET_32_BIG
@@ -3170,6 +3176,10 @@ template
void
Object::read_section_data<32, true>(elfcpp::Elf_file<32, true, Object>*,
Read_symbols_data*);
+template
+const unsigned char*
+Object::find_shdr<32,true>(const unsigned char*, const char*, const char*,
+ section_size_type, const unsigned char*) const;
#endif
#ifdef HAVE_TARGET_64_LITTLE
@@ -3177,6 +3187,10 @@ template
void
Object::read_section_data<64, false>(elfcpp::Elf_file<64, false, Object>*,
Read_symbols_data*);
+template
+const unsigned char*
+Object::find_shdr<64,false>(const unsigned char*, const char*, const char*,
+ section_size_type, const unsigned char*) const;
#endif
#ifdef HAVE_TARGET_64_BIG
@@ -3184,6 +3198,10 @@ template
void
Object::read_section_data<64, true>(elfcpp::Elf_file<64, true, Object>*,
Read_symbols_data*);
+template
+const unsigned char*
+Object::find_shdr<64,true>(const unsigned char*, const char*, const char*,
+ section_size_type, const unsigned char*) const;
#endif
#ifdef HAVE_TARGET_32_LITTLE