[Bug ld/28348] ld generates corrupted binaries with -lc

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

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com
Summary|ld generates corrupted  |ld generates corrupted
   |binaries with clang |binaries with -lc
   |-fsanitize=address -lc  |

--- Comment #1 from H.J. Lu  ---
[hjl@gnu-gram-1 longjmp]$ cat x.c
#include 

jmp_buf buf;

int
main ()
{
  longjmp (buf,1);
  return 0;
}
[hjl@gnu-gram-1 longjmp]$ cat y.c
#include 

__attribute__ ((weak))
void
longjmp(jmp_buf env, int val)
{
}
[hjl@gnu-gram-1 longjmp]$ make
gcc-c -o x.o x.c
gcc-c -o y.o y.c
/usr/include/setjmp.h: In function ‘longjmp’:
y.c:7:1: warning: ‘noreturn’ function does return
7 | }
  | ^
gcc -o x x.o y.o -lc -pthread
readelf --wide --dyn-syms x | grep longjmp
 3: 0040111915 FUNCWEAK   DEFAULT   12 longjmp@@
[hjl@gnu-gram-1 longjmp]$

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


[Bug ld/28348] ld generates corrupted binaries with -lc

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

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

https://sourceware.org/pipermail/binutils/2021-September/117972.html

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


[Bug ld/28348] ld generates corrupted binaries with -lc

2021-09-19 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=28348

--- Comment #3 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=e4675a5810fc3d0a7d0b1c744f0a1837ccc0507e

commit e4675a5810fc3d0a7d0b1c744f0a1837ccc0507e
Author: H.J. Lu 
Date:   Sat Sep 18 09:12:27 2021 -0700

elf: Don't set version info on unversioned symbols

Don't set version info on unversioned symbols when seeing a hidden
versioned symbol after an unversioned definition and the default
versioned symbol.

bfd/

PR ld/28348
* elflink.c (elf_link_add_object_symbols): Don't set version info
on unversioned symbols.

ld/

PR ld/28348
* testsuite/ld-elf/pr28348.rd: New file.
* testsuite/ld-elf/pr28348.t: Likewise.
* testsuite/ld-elf/pr28348a.c: Likewise.
* testsuite/ld-elf/pr28348b.c: Likewise.
* testsuite/ld-elf/pr28348c.c: Likewise.
* testsuite/ld-elf/shared.exp: Run PR ld/28348 tests.

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


[Bug ld/28348] ld generates corrupted binaries with -lc

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

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.38

--- Comment #4 from H.J. Lu  ---
Fixed for 2.38.

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


[Bug ld/28348] ld generates corrupted binaries with -lc

2021-09-26 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=28348

Sam James  changed:

   What|Removed |Added

 CC||sam at gentoo dot org,
   ||toolchain at gentoo dot org

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