aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-07-22 08:09:48 +0000
committerIan Lance Taylor <ian@airs.com>2008-07-22 08:09:48 +0000
commite0b640329e833ef6338cf962f153f5bdb4ba7eed (patch)
treef4c601e6a4add3471d5ec41dbe1f64b95563608f /gold/output.cc
parentbda987c255396672f917107bb819a99d204c7d89 (diff)
downloadfsf-binutils-gdb-e0b640329e833ef6338cf962f153f5bdb4ba7eed.zip
fsf-binutils-gdb-e0b640329e833ef6338cf962f153f5bdb4ba7eed.tar.gz
fsf-binutils-gdb-e0b640329e833ef6338cf962f153f5bdb4ba7eed.tar.bz2
* output.cc (Output_section::add_input_section): Don't try to
merge empty merge sections.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 6ec4aef..a24ee5f 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -1819,9 +1819,11 @@ Output_section::add_input_section(Sized_relobj<size, big_endian>* object,
// If this is a SHF_MERGE section, we pass all the input sections to
// a Output_data_merge. We don't try to handle relocations for such
- // a section.
+ // a section. We don't try to handle empty merge sections--they
+ // mess up the mappings, and are useless anyhow.
if ((sh_flags & elfcpp::SHF_MERGE) != 0
- && reloc_shndx == 0)
+ && reloc_shndx == 0
+ && shdr.get_sh_size() > 0)
{
if (this->add_merge_input_section(object, shndx, sh_flags,
entsize, addralign))