This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold commit] Fix placement of forced local symbols in the dynamic symbol table
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Thu, 22 Dec 2016 16:02:03 -0800
- Subject: [gold commit] Fix placement of forced local symbols in the dynamic symbol table
- Authentication-results: sourceware.org; auth=none
Gold was not placing forced-local symbols (e.g., hidden visibility) at
the front of the dynamic symbol table, or including them in the count
of local symbols recorded in the .dynsym section's sh_info field.
-cary
2016-12-22 Cary Coutant <ccoutant@gmail.com>
gold/
* layout.cc (Layout::finalize): Track count of forced-local symbols
in .dynsym.
(Layout::create_symtab_sections): Add local_dynamic_count parameter;
use that instead of sh_info value.
(Layout::create_dynamic_symtab): Add pforced_local_dynamic_count
parameter; pass it to Symtab::set_dynsym_indexes(). Include forced
locals in sh_info value. Pass index of first real global to
Dynobj::create_gnu_hash_table() and Dynobj::create_elf_hash_table().
* layout.h (Layout::create_symtab_sections): Add local_dynamic_count
parameter.
(Layout::create_dynamic_symtab): Add pforced_local_dynamic_count
parameter.
* symtab.cc (Symbol_table::set_dynsym_indexes): Add pforced_local_count
parameter. Process forced-local symbols first and return the count.
(Symbol_table::finalize): Update comments.
* symtab.h (Symbol_table::set_dynsym_indexes): Add pforced_local_count
parameter.
(Symbol_table::first_dynamic_global_index_): Update comment.
(Symbol_table::dynamic_count_): Update comment.
* testsuite/Makefile.am (ifuncmod1.sh): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/ifuncmod1.sh: New shell script.