From ae034989da9cc0805cb02a6bd53f4fce3a5adfe9 Mon Sep 17 00:00:00 2001 From: Sriraman Tallam Date: Tue, 16 Oct 2012 16:50:32 +0000 Subject: [PATCH] 2012-10-16 Sriraman Tallam * layout.cc (Layout::include_section): Keep sections marked SHF_EXCLUDE when doing relocatable links. --- gold/ChangeLog | 5 +++++ gold/layout.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index da35cbcb3d3..7f7c01206bc 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2012-10-16 Sriraman Tallam + + * layout.cc (Layout::include_section): Keep sections marked + SHF_EXCLUDE when doing relocatable links. + 2012-10-16 Alan Modra * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func. diff --git a/gold/layout.cc b/gold/layout.cc index 86e39ebcf68..022f5a9cdd5 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -582,7 +582,8 @@ bool Layout::include_section(Sized_relobj_file*, const char* name, const elfcpp::Shdr& 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()) -- 2.30.2