[Bug ld/31652] weak def in discarded comdat section becomes unreferenced undefweak with ld -r

2024-04-23 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=31652

--- Comment #5 from Sourceware Commits  ---
The master branch has been updated by H.J. Lu :

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

commit 9b441c415c556e608e22cb9d16b500992a972b0c
Author: Olivier Hainque 
Date:   Mon Apr 22 02:50:28 2024 -0300

bfd: Remove duplicate word in elf-vxworks.c

PR ld/31652
* elf-vxworks.c  (elf_vxworks_emit_relocs): Drop duplicate word.

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


[Bug ld/31652] weak def in discarded comdat section becomes unreferenced undefweak with ld -r

2024-04-19 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=31652

--- Comment #4 from Sourceware Commits  ---
The master branch has been updated by Alan Modra :

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

commit 9cf3c87e166b2f3728ae5c50c501f64f385e349e
Author: Alan Modra 
Date:   Fri Apr 19 16:35:30 2024 +0930

Re: elf: Strip unreferenced weak undefined symbols

PR ld/31652
* elflink.c (_bfd_elf_link_output_relocs): Don't segfault
on NULL rel_hash.

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


[Bug ld/31652] weak def in discarded comdat section becomes unreferenced undefweak with ld -r

2024-04-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31652

H.J. Lu  changed:

   What|Removed |Added

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

--- Comment #3 from H.J. Lu  ---
Fixed.

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


[Bug ld/31652] weak def in discarded comdat section becomes unreferenced undefweak with ld -r

2024-04-18 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=31652

--- Comment #2 from Sourceware Commits  ---
The master branch has been updated by H.J. Lu :

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

commit eebad48ef858be83d754a6b1326133e51d36
Author: H.J. Lu 
Date:   Thu Apr 18 05:28:56 2024 -0700

elf: Strip unreferenced weak undefined symbols

Linker will resolve an undefined symbol only if it is referenced by
relocation.  Unreferenced weak undefined symbols serve no purpose.
Weak undefined symbols appear in the dynamic symbol table only when they
are referenced by dynamic relocation.  Mark symbols with relocation and
strip undefined weak symbols if they don't have relocation and aren't
in the dynamic symbol table.

bfd/

PR ld/31652
* elf-bfd.h (elf_link_hash_entry): Add has_reloc.
* elf-vxworks.c (elf_vxworks_emit_relocs): Set has_reloc.
* elflink.c (_bfd_elf_link_output_relocs): Likewise.
(elf_link_output_extsym): Strip undefined weak symbols if they
don't have relocation and aren't in the dynamic symbol table.

ld/

PR ld/31652
* testsuite/ld-elf/elf.exp: Run undefweak tests.
* testsuite/ld-elf/undefweak-1.rd: New file.
* testsuite/ld-elf/undefweak-1a.s: Likewise.
* testsuite/ld-elf/undefweak-1b.s: Likewise.
* testsuite/ld-x86-64/weakundef-1.nd: Likewise.
* testsuite/ld-x86-64/weakundef-1a.s: Likewise.
* testsuite/ld-x86-64/weakundef-1b.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run undefweak tests.

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


[Bug ld/31652] weak def in discarded comdat section becomes unreferenced undefweak with ld -r

2024-04-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31652

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.43

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

https://sourceware.org/pipermail/binutils/2024-April/133694.html

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


[Bug ld/31652] weak def in discarded comdat section becomes unreferenced undefweak with ld -r

2024-04-18 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31652

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

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