summaryrefslogtreecommitdiff
path: root/gold/target.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2014-04-15 11:24:30 -0700
committerCary Coutant <ccoutant@google.com>2014-04-15 11:56:18 -0700
commit99fd8cfff7a9da67efc2e6c627176f5c767c6e7d (patch)
tree90c4ff3cb8fb668ab8bb7e17adc06654de339482 /gold/target.h
parent91f43acd5d692518f95a901e92dec7dbb6347564 (diff)
downloadbinutils-gdb-99fd8cfff7a9da67efc2e6c627176f5c767c6e7d.tar.gz
Allow target to decide whether to include a section.
2014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com> gold/ * layout.cc (Layout::include_section): Allow a target to decide whether to include a section. * target.h (Target::should_include_section): New function. (Target::do_should_include_section): New function.
Diffstat (limited to 'gold/target.h')
-rw-r--r--gold/target.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gold/target.h b/gold/target.h
index aaf4b1ccaab..e3805910301 100644
--- a/gold/target.h
+++ b/gold/target.h
@@ -480,6 +480,11 @@ class Target
adjust_dyn_symbol(const Symbol* sym, unsigned char* view) const
{ this->do_adjust_dyn_symbol(sym, view); }
+ // Return whether to include the section in the link.
+ bool
+ should_include_section(elfcpp::Elf_Word sh_type) const
+ { return this->do_should_include_section(sh_type); }
+
protected:
// This struct holds the constant information for a child class. We
// use a struct to avoid the overhead of virtual function calls for
@@ -773,6 +778,11 @@ class Target
do_adjust_dyn_symbol(const Symbol*, unsigned char*) const
{ }
+ // This may be overridden by the child class.
+ virtual bool
+ do_should_include_section(elfcpp::Elf_Word) const
+ { return true; }
+
private:
// The implementations of the four do_make_elf_object virtual functions are
// almost identical except for their sizes and endianness. We use a template.