aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-04-24 14:32:23 +0000
committerIan Lance Taylor <ian@airs.com>2010-04-24 14:32:23 +0000
commitbd288ea21b2dbb853d166fddd980bf9d03bdb009 (patch)
tree4f48ddaa5daa18bc89c8bba57c491357b14ce13b /gold/layout.cc
parentab38a727c990476872ac4995792fc0d38d922d7f (diff)
downloadgdb-bd288ea21b2dbb853d166fddd980bf9d03bdb009.zip
gdb-bd288ea21b2dbb853d166fddd980bf9d03bdb009.tar.gz
gdb-bd288ea21b2dbb853d166fddd980bf9d03bdb009.tar.bz2
* layout.cc (Layout::layout_reloc): In relocatable link don't
combine reloc sections for grouped sections.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 2ffbdf4..36cfa8b 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -699,11 +699,20 @@ Layout::layout_reloc(Sized_relobj<size, big_endian>* 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);