Hidden dynamic symbols

Paul Brook paul@codesourcery.com
Wed Feb 9 21:55:00 GMT 2005


The elf spec says that dynamic symbols with STV_HIDDEN or STV_INTERNAL 
visibility must either be removed or given STB_LOCAL binding.

We currently get this wrong when a hidden/internal symbol is provided by a 
linker script.

The attached patch fixes this by forcing such symbols to be local, and 
modifying the symbol renumbering to cope with this. I chose this alternative 
because (a) it seemed simpler, and (b) I have a target that needs to output 
dynamic relocations against these symbols.

Tested on i686-linux --enable-targets=all.
Ok?

Paul

2005-02-09  Paul Brook  <paul@codesourcery.com>

 * elflink.c (bfd_elf_record_link_assignment): Make hidden and internal
 symbols local.
 (elf_link_renumber_hash_table_dynsyms): Ignore local symbols.
 (elf_link_renumber_local_hash_table_dynsyms): New function.
 (_bfd_elf_link_renumber_dynsyms): Number local dynamic symbols.
ld/testsuite/
 * ld-elfvsb/hidden2.s: New file
 * ld-elfvsb/hidden2.d: New file
 * ld-elfvsb/hidden2.ld: New file
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.hidden_dynsym
Type: text/x-diff
Size: 3777 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050209/37ec45de/attachment.bin>


More information about the Binutils mailing list