2012-10-16 Sriraman Tallam <tmsriram@google.com>
authorSriraman Tallam <tmsriram@google.com>
Tue, 16 Oct 2012 16:50:32 +0000 (16:50 +0000)
committerSriraman Tallam <tmsriram@google.com>
Tue, 16 Oct 2012 16:50:32 +0000 (16:50 +0000)
* layout.cc (Layout::include_section): Keep sections marked
SHF_EXCLUDE when doing relocatable links.

gold/ChangeLog
gold/layout.cc

index da35cbcb3d3b4a63f5a03f14dd766328d89c5e66..7f7c01206bc9b9c20202546abfd0eda0054008dd 100644 (file)
@@ -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.
index 86e39ebcf688949c43e1f1ba7642260eda2fabcf..022f5a9cdd55d5ed1bfa60a6c41742925de659e9 100644 (file)
@@ -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())