From 82d93790a85300d8452450b6d43efb6b15b53788 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Mon, 5 Dec 2016 10:41:09 -0800 Subject: Fix problem where absolute local symbols are omitted when output has many sections. 2016-12-05 Cary Coutant Tristan Gingold gold/ * object.cc (Sized_relobj_file::do_count_local_symbols): Check is_ordinary before using shndx. * testsuite/Makefile.am (file_in_many_sections_test.sh): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/file_in_many_sections.c: New source file. * testsuite/file_in_many_sections_test.sh: New script. --- gold/object.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gold/object.cc') diff --git a/gold/object.cc b/gold/object.cc index a631c99..72afc45 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -2225,8 +2225,9 @@ Sized_relobj_file::do_count_local_symbols(Stringpool* pool, // Decide whether this symbol should go into the output file. - if ((shndx < shnum && out_sections[shndx] == NULL) - || shndx == this->discarded_eh_frame_shndx_) + if (is_ordinary + && ((shndx < shnum && out_sections[shndx] == NULL) + || shndx == this->discarded_eh_frame_shndx_)) { lv.set_no_output_symtab_entry(); gold_assert(!lv.needs_output_dynsym_entry()); -- cgit v1.1