aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
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/layout.cc
parent91f43acd5d692518f95a901e92dec7dbb6347564 (diff)
downloadgdb-99fd8cfff7a9da67efc2e6c627176f5c767c6e7d.zip
gdb-99fd8cfff7a9da67efc2e6c627176f5c767c6e7d.tar.gz
gdb-99fd8cfff7a9da67efc2e6c627176f5c767c6e7d.tar.bz2
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/layout.cc')
-rw-r--r--gold/layout.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index c96516c..02f691e 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -644,7 +644,13 @@ Layout::include_section(Sized_relobj_file<size, big_endian>*, const char* name,
&& (shdr.get_sh_flags() & elfcpp::SHF_EXCLUDE))
return false;
- switch (shdr.get_sh_type())
+ elfcpp::Elf_Word sh_type = shdr.get_sh_type();
+
+ if ((sh_type >= elfcpp::SHT_LOOS && sh_type <= elfcpp::SHT_HIOS)
+ || (sh_type >= elfcpp::SHT_LOPROC && sh_type <= elfcpp::SHT_HIPROC))
+ return parameters->target().should_include_section(sh_type);
+
+ switch (sh_type)
{
case elfcpp::SHT_NULL:
case elfcpp::SHT_SYMTAB: