From: Ian Lance Taylor Date: Sat, 24 Apr 2010 14:32:23 +0000 (+0000) Subject: * layout.cc (Layout::layout_reloc): In relocatable link don't X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd288ea21b2dbb853d166fddd980bf9d03bdb009;p=binutils-gdb.git * layout.cc (Layout::layout_reloc): In relocatable link don't combine reloc sections for grouped sections. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 153828cb7b0..5b502646169 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2010-04-24 Ian Lance Taylor + + * layout.cc (Layout::layout_reloc): In relocatable link don't + combine reloc sections for grouped sections. + 2010-04-23 Sriraman Tallam * gc.h (gc_process_relocs): Pass information on relocs pointing to diff --git a/gold/layout.cc b/gold/layout.cc index 2ffbdf49770..36cfa8bd744 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -699,11 +699,20 @@ Layout::layout_reloc(Sized_relobj* object, gold_unreachable(); name += data_section->name(); - Output_section* os = this->choose_output_section(object, name.c_str(), - sh_type, - shdr.get_sh_flags(), - false, false, false, - false, false, false); + // In a relocatable link relocs for a grouped section must not be + // combined with other reloc sections. + Output_section* os; + if (!parameters->options().relocatable() + || (data_section->flags() & elfcpp::SHF_GROUP) == 0) + os = this->choose_output_section(object, name.c_str(), sh_type, + shdr.get_sh_flags(), false, false, + false, false, false, false); + else + { + const char* n = this->namepool_.add(name.c_str(), true, NULL); + os = this->make_output_section(n, sh_type, shdr.get_sh_flags(), + false, false, false, false, false); + } os->set_should_link_to_symtab(); os->set_info_section(data_section);