From 1074bc6d41f480e9e7b8f2e68f778225da2559b7 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Sat, 14 Jul 2018 11:52:27 -0700 Subject: Fix internal error when using --emit-relocs with plugins. When an .eh_frame section has deferred layout because of plugins, gold was neglecting to mark the section as deferred. When we later processed the corresponding relocation section, we were then ignoring it, causing the internal error later on in the link. gold/ PR gold/23397 * object.cc (Sized_relobj_file::do_layout): Mark section as deferred. * testsuite/Makefile.am (plugin_test_1): Add --emit-relocs option to existing test case. * testsuite/Makefile.in: Regenerate. --- gold/object.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gold/object.cc') diff --git a/gold/object.cc b/gold/object.cc index 374340f..084212c 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -1742,9 +1742,13 @@ Sized_relobj_file::do_layout(Symbol_table* symtab, out_section_offsets[i] = invalid_address; } else if (this->is_deferred_layout()) - this->deferred_layout_.push_back( - Deferred_layout(i, name, sh_type, pshdrs, - reloc_shndx[i], reloc_type[i])); + { + out_sections[i] = reinterpret_cast(2); + out_section_offsets[i] = invalid_address; + this->deferred_layout_.push_back( + Deferred_layout(i, name, sh_type, pshdrs, + reloc_shndx[i], reloc_type[i])); + } else eh_frame_sections.push_back(i); continue; -- cgit v1.1