[Bug ld/26391] Question regarding duplicate symbols

2023-04-28 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #15 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=64b59b6bb2261fe2fa8310f94b4ed420c162e357

commit 64b59b6bb2261fe2fa8310f94b4ed420c162e357
Author: H.J. Lu 
Date:   Mon Jan 16 14:03:02 2023 -0800

ld: Use run_cc_link_tests for PR ld/26391 tests

Use run_cc_link_tests for PR ld/26391 tests to compile PR ld/26391 tests
in C.

PR ld/30002
* testsuite/ld-elf/elf.exp: Use run_cc_link_tests for PR ld/26391
tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2023-01-16 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #14 from cvs-commit at gcc dot gnu.org  ---
The try-PR26391 branch has been updated by Mark Wielaard :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=99175c84026b1bfa534f3946150535c39027911d

commit 99175c84026b1bfa534f3946150535c39027911d
Author: Sam James 
Date:   Mon Jan 16 14:03:02 2023 -0800

ld: Use run_cc_link_tests for PR ld/26391 tests

Use run_cc_link_tests for PR ld/26391 tests to compile PR ld/26391 tests
in C.

PR ld/30002
* testsuite/ld-elf/elf.exp: Use run_cc_link_tests for PR ld/26391
tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2023-01-14 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

Sam James  changed:

   What|Removed |Added

 CC||sam at gentoo dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2023-01-14 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

Sam James  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=30002

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2021-12-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #13 from H.J. Lu  ---
Created attachment 13877
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13877=edit
sparc64-linux binaries

I built sparc64-linux pr26391-5 and pr26391-6 binaries with a cross
compiler on Linux/x8-64.  They run fine on sparc64-linux:

hjl@gcc102:~$ cd /tmp/
hjl@gcc102:/tmp$ ./pr26391-5
bar 1
bar 2
bar 3
hjl@gcc102:/tmp$ ./pr26391-6
bar 1
bar 2
bar 3
hjl@gcc102:/tmp$ 

If they fail in binutils tests on sparc64-linux, it is caused by
sparc64-linux hardware, kernel, glibc, binutils, ... bugs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2021-12-15 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #12 from H.J. Lu  ---
I don't know why "ld -r -z unique-symbol" generates incorrect output
on sparc64.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2021-12-15 Thread glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #11 from John Paul Adrian Glaubitz  ---
(In reply to John Paul Adrian Glaubitz from comment #10)
> It seems that this test is failing on sparc64:
> 
> FAIL: Run pr26391-5
> FAIL: Run pr26391-6
> 
> See:
> https://buildd.debian.org/status/fetch.php?pkg=binutils=sparc64=2.
> 37-10=1637614637=0

I have verified that this commit introduced the regression on sparc64:

496afd17055aeb7d8f45e01715c475664f2b73bd is the first bad commit
commit 496afd17055aeb7d8f45e01715c475664f2b73bd
Author: H.J. Lu 
Date:   Sat Sep 12 05:37:30 2020 -0700

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2021-12-15 Thread glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

John Paul Adrian Glaubitz  changed:

   What|Removed |Added

 CC||glaubitz at physik dot 
fu-berlin.d
   ||e

--- Comment #10 from John Paul Adrian Glaubitz  ---
It seems that this test is failing on sparc64:

FAIL: Run pr26391-5
FAIL: Run pr26391-6

See:
https://buildd.debian.org/status/fetch.php?pkg=binutils=sparc64=2.37-10=1637614637=0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-13 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #9 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1f656a652ea8d489b5aa5b7f55c535fc9e6b0b29

commit 1f656a652ea8d489b5aa5b7f55c535fc9e6b0b29
Author: Alan Modra 
Date:   Sun Sep 13 17:56:52 2020 +0930

Re: elf: Add -z unique-symbol

PR 26391
* testsuite/ld-elf/pr26391.nd: Adjust to match powerpc64 function
descriptors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-12 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #7 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=496afd17055aeb7d8f45e01715c475664f2b73bd

commit 496afd17055aeb7d8f45e01715c475664f2b73bd
Author: H.J. Lu 
Date:   Sat Sep 12 05:37:30 2020 -0700

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-12 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

H.J. Lu  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #8 from H.J. Lu  ---
Fixed for 2.36.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-09 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.36
URL||https://sourceware.org/pipe
   ||rmail/binutils/2020-Septemb
   ||er/113271.html

--- Comment #6 from H.J. Lu  ---
A patch is posted at

https://sourceware.org/pipermail/binutils/2020-September/113271.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-09 Thread kaccardi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #5 from Kristen Carlson Accardi  ---
https://lore.kernel.org/live-patching/4dc070f53f4f96b47dba4e4e51bb65d75f2071bb.ca...@linux.intel.com/T/#mb29f61d93a1f0307212053c90ab86cb9fe5a64ee

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-09 Thread kaccardi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #4 from Kristen Carlson Accardi  ---
This feature was well received by the livepatch maintainers. It not only solves
my individual problem, but also would allow them to more precisely locate
duplicate symbols in general for patching. I'd like to request that this
feature be implemented in a future release.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-08-22 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #3 from H.J. Lu  ---
I updated my branch to rename the option name to "-z unique-symbol".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-08-21 Thread kaccardi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #2 from Kristen Carlson Accardi  ---
This works for me! Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-08-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #1 from H.J. Lu  ---
Please try

https://gitlab.com/x86-binutils/binutils-gdb/-/tree/users/hjl/pr26391/master

You can pass -z unique to ld to make local symbols unique.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-08-14 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

H.J. Lu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-08-14
 CC||hjl.tools at gmail dot com
 Status|UNCONFIRMED |NEW
Version|unspecified |2.36 (HEAD)
  Component|binutils|ld

-- 
You are receiving this mail because:
You are on the CC list for the bug.