[PATCH] elf: Add -z unique-symbol to avoid duplicated local symbol names
Alan Modra
amodra@gmail.com
Sat Sep 12 07:47:15 GMT 2020
More information about the Binutils mailing list
Sat Sep 12 07:47:15 GMT 2020
- Previous message (by thread): [PATCH] elf: Add -z unique-symbol to avoid duplicated local symbol names
- Next message (by thread): [PATCH] elf: Add -z unique-symbol to avoid duplicated local symbol names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Sep 09, 2020 at 09:20:25AM -0700, H.J. Lu via Binutils wrote:
> The symbol string table in the .symtab section is optional and cosmetic.
> The contents of the .symtab section have no impact on run-time execution.
> The symbol names in the symbol string table help distinguish addresses at
> different locations. Add a linker option, -z unique-symbol, to avoid
> duplicated local symbol names in the symbol string table.
>
> This feature was well received by the livepatch maintainers. It not only
> solves the duplicated local symbol name problem, but also would allow
> livepatch to more precisely locate duplicate symbols in general for
> patching.
>
> bfd/
>
> PR ld/26391
> * elflink.c (elf_final_link_info): Add local_hash_table.
> (local_hash_entry): New.
> (local_hash_newfunc): Likewise.
> (elf_link_output_symstrtab): Append ".COUNT" to duplicated local
> symbols.
> (bfd_elf_final_link): Initialize and free local_hash_table for
> "-z unique-symbol".
>
> include/
>
> PR ld/26391
> * bfdlink.h (bfd_link_info): Add unique_symbol.
>
> ld/
>
> PR ld/26391
> * NEWS: Mention "-z unique-symbol".
> * emultempl/elf.em (gld${EMULATION_NAME}_handle_option): Handle
> "-z unique-symbol" and "-z nounique-symbol".
> * ld.texi: Document "-z unique-symbol" and "-z nounique-symbol".
> * lexsup.c (elf_static_list_options): Add "-z unique-symbol" and
> "-z nounique-symbol".
> * testsuite/ld-elf/elf.exp: Add PR ld/26391 tests.
> * testsuite/ld-elf/pr26391.nd: New file.
> * testsuite/ld-elf/pr26391.out: Likewise.
> * testsuite/ld-elf/pr26391a.c: Likewise.
> * testsuite/ld-elf/pr26391b.c: Likewise.
> * testsuite/ld-elf/pr26391c.c: Likewise.
> * testsuite/ld-elf/pr26391d.c: Likewise.
Looks OK to me.
--
Alan Modra
Australia Development Lab, IBM
- Previous message (by thread): [PATCH] elf: Add -z unique-symbol to avoid duplicated local symbol names
- Next message (by thread): [PATCH] elf: Add -z unique-symbol to avoid duplicated local symbol names
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list