aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2010-05-26 15:47:39 +0000
committerRafael Ávila de Espíndola <respindola@mozilla.com>2010-05-26 15:47:39 +0000
commit5e0f337e8c5e217a1560d89dac9719881272fd16 (patch)
tree25fe08fd5dbe113445925baef204116932d24502 /gold/object.cc
parent947bb88ff5da0770e9d6a238b54b7053ba8bd6fb (diff)
downloadgdb-5e0f337e8c5e217a1560d89dac9719881272fd16.zip
gdb-5e0f337e8c5e217a1560d89dac9719881272fd16.tar.gz
gdb-5e0f337e8c5e217a1560d89dac9719881272fd16.tar.bz2
2010-05-26 Rafael Espindola <espindola@google.com>
PR 11604 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid adding sections the garbage collector removed. * gold/testsuite/Makefile.am: Add test. * gold/testsuite/Makefile.in: Regenerate. * gold/testsuite/plugin_test_7.sh: New. * gold/testsuite/plugin_test_7_1.c: New. * gold/testsuite/plugin_test_7_2.c: New.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gold/object.cc b/gold/object.cc
index 8751d55..9581fd8 100644
--- a/gold/object.cc
+++ b/gold/object.cc
@@ -1461,6 +1461,11 @@ Sized_relobj<size, big_endian>::do_layout_deferred_sections(Layout* layout)
++deferred)
{
typename This::Shdr shdr(deferred->shdr_data_);
+ // If the section is not included, it is because the garbage collector
+ // decided it is not needed. Avoid reverting that decision.
+ if (!this->is_section_included(deferred->shndx_))
+ continue;
+
this->layout_section(layout, deferred->shndx_, deferred->name_.c_str(),
shdr, deferred->reloc_shndx_, deferred->reloc_type_);
}