aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2013-07-31 18:47:50 +0000
committerCary Coutant <ccoutant@google.com>2013-07-31 18:47:50 +0000
commitc6905c28a51b6716f2d0243a76825e2dd6ad59de (patch)
tree9406e5291db3fd1e4fe8e3e1bf8a8c3de9b22404 /gold/object.cc
parent31a91d61f9ea4504812349166ef6ad5308270927 (diff)
downloadfsf-binutils-gdb-c6905c28a51b6716f2d0243a76825e2dd6ad59de.zip
fsf-binutils-gdb-c6905c28a51b6716f2d0243a76825e2dd6ad59de.tar.gz
fsf-binutils-gdb-c6905c28a51b6716f2d0243a76825e2dd6ad59de.tar.bz2
gold/
* object.cc (Sized_relobj::do_output_section_address): New function. (Sized_relobj): Instantiate explicitly. * object.h (Object::output_section_address): New function. (Object::do_output_section_address): New function. (Sized_relobj::do_output_section_address): New function. * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/gold/object.cc b/gold/object.cc
index 1f113d1..c98b3c5 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -389,6 +389,23 @@ Sized_relobj<size, big_endian>::do_for_all_local_got_entries(
}
}
+// Get the address of an output section.
+
+template<int size, bool big_endian>
+uint64_t
+Sized_relobj<size, big_endian>::do_output_section_address(
+ unsigned int shndx)
+{
+ // If the input file is linked as --just-symbols, the output
+ // section address is the input section address.
+ if (this->just_symbols())
+ return this->section_address(shndx);
+
+ const Output_section* os = this->do_output_section(shndx);
+ gold_assert(os != NULL);
+ return os->address();
+}
+
// Class Sized_relobj_file.
template<int size, bool big_endian>
@@ -3217,21 +3234,33 @@ Object::find_shdr<64,true>(const unsigned char*, const char*, const char*,
#ifdef HAVE_TARGET_32_LITTLE
template
+class Sized_relobj<32, false>;
+
+template
class Sized_relobj_file<32, false>;
#endif
#ifdef HAVE_TARGET_32_BIG
template
+class Sized_relobj<32, true>;
+
+template
class Sized_relobj_file<32, true>;
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
+class Sized_relobj<64, false>;
+
+template
class Sized_relobj_file<64, false>;
#endif
#ifdef HAVE_TARGET_64_BIG
template
+class Sized_relobj<64, true>;
+
+template
class Sized_relobj_file<64, true>;
#endif