aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2012-10-16 16:50:32 +0000
committerSriraman Tallam <tmsriram@google.com>2012-10-16 16:50:32 +0000
commitfcb2731c82ebeaa3f2e4f29cf49d96523bafe544 (patch)
tree7e56b881770e57eb6f22b5faea7b7649bab5f7b1
parent142208fa32e05f04fb92dbd686490a3cb9b6f56d (diff)
downloadbinutils-fcb2731c82ebeaa3f2e4f29cf49d96523bafe544.tar.gz
2012-10-16 Sriraman Tallam <tmsriram@google.com>
* layout.cc (Layout::include_section): Keep sections marked SHF_EXCLUDE when doing relocatable links.
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/layout.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index da35cbcb3..7f7c01206 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-16 Sriraman Tallam <tmsriram@google.com>
+
+ * layout.cc (Layout::include_section): Keep sections marked
+ SHF_EXCLUDE when doing relocatable links.
+
2012-10-16 Alan Modra <amodra@gmail.com>
* powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
diff --git a/gold/layout.cc b/gold/layout.cc
index 86e39ebcf..022f5a9cd 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -582,7 +582,8 @@ bool
Layout::include_section(Sized_relobj_file<size, big_endian>*, const char* name,
const elfcpp::Shdr<size, big_endian>& shdr)
{
- if (shdr.get_sh_flags() & elfcpp::SHF_EXCLUDE)
+ if (!parameters->options().relocatable()
+ && (shdr.get_sh_flags() & elfcpp::SHF_EXCLUDE))
return false;
switch (shdr.get_sh_type())