aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
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_);
}