binutils-gdb/include
H.J. Lu 496afd1705 elf: Add -z unique-symbol to avoid duplicated local symbol names
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.
2020-09-12 05:37:43 -07:00
..
aout Fixes for the magic number used in PDP11 AOUT binaries. 2020-04-14 14:41:27 +01:00
cgen
coff Remove powerpc PE support 2020-07-09 22:58:16 +09:30
elf x86: Add NT_X86_CET note 2020-09-11 05:52:06 -07:00
gdb
mach-o Recognize some new Mach-O load commands 2020-06-22 14:29:20 +01:00
opcode CSKY: Change ISA flag's type to bfd_uint64_t and fix build error. 2020-09-12 00:56:01 +08:00
som PR26457 UBSAN: som.c:1794 left shift cannot be represented 2020-08-31 20:28:09 +09:30
vms
alloca-conf.h
ansidecl.h
bfdlink.h elf: Add -z unique-symbol to avoid duplicated local symbol names 2020-09-12 05:37:43 -07:00
binary-io.h
bout.h
ChangeLog elf: Add -z unique-symbol to avoid duplicated local symbol names 2020-09-12 05:37:43 -07:00
ChangeLog-0415
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-9103
COPYING
COPYING3
ctf-api.h libctf, binutils, include, ld: gettextize and improve error handling 2020-08-27 13:15:43 +01:00
ctf.h libctf: error out on corrupt CTF with invalid header flags 2020-07-22 17:57:54 +01:00
demangle.h
diagnostics.h ada-lex.l: Ignore register diagnostic also for g++ defaulting to ISO C++17 2020-08-23 12:14:34 +02:00
dis-asm.h
dwarf2.def
dwarf2.h For DWARF v5 Dwarf Package Files (.dwp files), the section identifier encodings have changed. This patch updates dwarf2.h to contain the new encodings. (see http://dwarfstd.org/doc/DWARF5.pdf, section 7.3.5). 2020-07-29 16:33:07 +01:00
dyn-string.h
environ.h
fibheap.h
filenames.h Sync config, include and libiberty with GCC 2020-06-24 16:52:48 -07:00
floatformat.h Sync include, libiberty with GCC. 2020-09-11 11:32:00 -07:00
fnmatch.h
fopen-bin.h
fopen-same.h
fopen-vms.h
gcc-c-fe.def
gcc-c-interface.h
gcc-cp-fe.def
gcc-cp-interface.h
gcc-interface.h
getopt.h
hashtab.h Merge upstream GCC changes for include/ and libiberty/ directories 2020-02-25 17:04:42 +00:00
hp-symtab.h
leb128.h
libiberty.h Remove the use of the register keyword in the libiberty.h header file - it is deprecated and incompatible with C++17. 2020-06-25 11:16:42 +01:00
longlong.h
lto-symtab.h include: Sync lto-symtab.h and plugin-api.h with GCC 2020-03-21 03:39:18 -07:00
MAINTAINERS
md5.h
oasys.h
objalloc.h
obstack.h
os9k.h
partition.h
plugin-api.h include: Sync plugin-api.h with GCC 2020-04-01 02:36:11 -07:00
progress.h
safe-ctype.h
sha1.h
simple-object.h
sort.h
splay-tree.h
symcat.h
timeval-utils.h
vtv-change-permission.h
xregex2.h
xregex.h
xtensa-config.h
xtensa-isa-internal.h
xtensa-isa.h