aboutsummaryrefslogtreecommitdiff
path: root/gold/object.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2016-12-05 10:41:09 -0800
committerCary Coutant <ccoutant@gmail.com>2016-12-05 10:41:09 -0800
commit82d93790a85300d8452450b6d43efb6b15b53788 (patch)
tree85c425898bd936ae050993bca517a206c1c2e470 /gold/object.cc
parentf49547a604b4dd2c75e3636d4a422d52edc4fa6c (diff)
downloadfsf-binutils-gdb-82d93790a85300d8452450b6d43efb6b15b53788.zip
fsf-binutils-gdb-82d93790a85300d8452450b6d43efb6b15b53788.tar.gz
fsf-binutils-gdb-82d93790a85300d8452450b6d43efb6b15b53788.tar.bz2
Fix problem where absolute local symbols are omitted when output has many sections.
2016-12-05 Cary Coutant <ccoutant@gmail.com> Tristan Gingold <gingold@adacore.com> 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.
Diffstat (limited to 'gold/object.cc')
-rw-r--r--gold/object.cc5
1 files changed, 3 insertions, 2 deletions
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<size, big_endian>::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());