summaryrefslogtreecommitdiff
path: root/gold/object.h
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.h
parent31a91d61f9ea4504812349166ef6ad5308270927 (diff)
downloadbinutils-gdb-c6905c28a51b6716f2d0243a76825e2dd6ad59de.tar.gz
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.h')
-rw-r--r--gold/object.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gold/object.h b/gold/object.h
index c17c13d2856..ae6d9bf4d31 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -551,6 +551,13 @@ class Object
output_section(unsigned int shndx) const
{ return this->do_output_section(shndx); }
+ // Given a section index, return its address.
+ // The return value will be -1U if the section is specially mapped,
+ // such as a merge section.
+ uint64_t
+ output_section_address(unsigned int shndx)
+ { return this->do_output_section_address(shndx); }
+
// Given a section index, return the offset in the Output_section.
// The return value will be -1U if the section is specially mapped,
// such as a merge section.
@@ -852,6 +859,11 @@ class Object
do_output_section(unsigned int) const
{ gold_unreachable(); }
+ // Get the address of a section--implemented by child class.
+ virtual uint64_t
+ do_output_section_address(unsigned int)
+ { gold_unreachable(); }
+
// Get the offset of a section--implemented by child class.
virtual uint64_t
do_output_section_offset(unsigned int) const
@@ -1929,6 +1941,10 @@ class Sized_relobj : public Relobj
section_offsets()
{ return this->section_offsets_; }
+ // Get the address of an output section.
+ uint64_t
+ do_output_section_address(unsigned int shndx);
+
// Get the offset of a section.
uint64_t
do_output_section_offset(unsigned int shndx) const