[Bug gold/32071] undefined weak hidden function symbols resolves to garbage with PIE

2024-08-31 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=32071

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

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

commit 229ecf80f35c64145678e537daf54358d16107e3
Author: H.J. Lu 
Date:   Wed Aug 21 08:06:41 2024 -0700

gold: Always resolve non-default weak undefined to 0

Non-default weak undefined symbols in executable and shared library are
always resolved to 0 at runtime and don't need dynamic relocation.

Tested on i686, x86-64, powerpc64le and aarch64.

PR gold/32071
* symtab.cc (Symbol::final_value_is_known): Always resolve
non-default weak undefined symbol in executable and shared library
to 0 at runtime.
* symtab.h (Symbol::needs_dynamic_reloc): Return false for
non-default weak undefined symbol in executable and shared library.
* testsuite/Makefile.am: Add weak_undef_test_3 and
weak_undef_test_4 tests.
* testsuite/Makefile.in: Regenerated.
* testsuite/weak_undef_lib_4.c: New file.
* testsuite/weak_undef_test_3.c: Likewise.
* testsuite/weak_undef_test_4.c: Likewise.

Signed-off-by: H.J. Lu 

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


[Bug ld/32131] Should linker always check TLS relocation?

2024-08-31 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32131

H.J. Lu  changed:

   What|Removed |Added

Summary|Linker should always check  |Should linker always check
   |TLS relocation  |TLS relocation?

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


[Bug gold/32111] --incremental-full doesn't work

2024-08-31 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32111

H.J. Lu  changed:

   What|Removed |Added

Version|unspecified |2.44 (HEAD)

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


[Bug gold/32071] undefined weak hidden function symbols resolves to garbage with PIE

2024-08-31 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32071

H.J. Lu  changed:

   What|Removed |Added

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

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

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


[Bug ld/32131] New: Linker should always check TLS relocation

2024-08-31 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32131

Bug ID: 32131
   Summary: Linker should always check TLS relocation
   Product: binutils
   Version: 2.44 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
Target: i386, x86-64

[hjl@gnu-cfl-3 tls-3]$ vi tls-main1.c 
[hjl@gnu-cfl-3 tls-3]$ make
gcc -B./ -m32 -O2 -g -mtls-dialect=gnu2   -c -o tls-main1.o tls-main1.c
gcc -B./ -m32 -o x tls-main1.o tls-gd1.o
tls-gd1.o: TLS transition from R_386_TLS_GD to R_386_TLS_IE_32 against `gd' at
0x12 in section `.text' failed
./ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:24: x] Error 1
[hjl@gnu-cfl-3 tls-3]$ make clean
rm -f *.o foo* *.so
[hjl@gnu-cfl-3 tls-3]$ ls
ld  Makefile  tls-def1.c  tls-gd1.S  tls-main1.c  y
[hjl@gnu-cfl-3 tls-3]$ cat tls-gd1.S
.text
.p2align 4,,15
.globl  get_gd
.type   get_gd, @function
get_gd:
pushl   %ebx
call__x86.get_pc_thunk.bx
addl$_GLOBAL_OFFSET_TABLE_, %ebx
subl$8, %esp
movlgd@tlsgd(,%ebx,1), %eax
call___tls_get_addr@PLT
addl$8, %esp
popl%ebx
ret
.size   get_gd, .-get_gd
.section .text,"axG",@progbits,__x86.get_pc_thunk.bx,comdat,unique,1
.globl  __x86.get_pc_thunk.bx
.hidden __x86.get_pc_thunk.bx
.type   __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
movl(%esp), %ebx
ret
.section.note.GNU-stack,"",@progbits
[hjl@gnu-cfl-3 tls-3]$ cat tls-main1.c 
extern int * get_gd (void);
__thread int gd = 4;

int
main ()
{
  return get_gd () == &gd ? 0 : 1;
}
[hjl@gnu-cfl-3 tls-3]$ make y
gcc -B./ -m32 -O2 -g   -c -o tls-main1.o tls-main1.c
gcc -B./ -m32 -g -shared -o libtls-gd1.so tls-gd1.S
gcc -B./ -m32 -o y tls-main1.o libtls-gd1.so -Wl,-R,.
[hjl@gnu-cfl-3 tls-3]$ ./y
Segmentation fault (core dumped)
[hjl@gnu-cfl-3 tls-3]$ make x
gcc -B./ -m32-c -o tls-gd1.o tls-gd1.S
gcc -B./ -m32 -o x tls-main1.o tls-gd1.o
tls-gd1.o: TLS transition from R_386_TLS_GD to R_386_TLS_IE_32 against `gd' at
0x12 in section `.text' failed
./ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:24: x] Error 1
[hjl@gnu-cfl-3 tls-3]$ 

Linker should always issue an error for

movlgd@tlsgd(,%ebx,1), %eax

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


[Bug gas/32022] Assembler shouldn't accept invalid TLS instructions

2024-08-31 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32022

Sam James  changed:

   What|Removed |Added

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

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


[Bug gold/32071] undefined weak hidden function symbols resolves to garbage with PIE

2024-08-31 Thread ishitatsuyuki at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32071

--- Comment #5 from Tatsuyuki Ishi  ---
Thanks for fixing.

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


[Bug ld/32017] Linker failed to check invalid TLS sequence

2024-08-31 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32017

Sam James  changed:

   What|Removed |Added

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

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


[Bug gprofng/29760] [collect app] Support profiling an already running application

2024-08-31 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=29760

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/32123] Linker should check all invalid @TLSCALL usage

2024-08-31 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32123

Sam James  changed:

   What|Removed |Added

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

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


[Bug ld/32131] Should linker always check TLS relocation?

2024-08-31 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32131

Sam James  changed:

   What|Removed |Added

 CC||sam at gentoo dot org
   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=32017,
   ||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=32022,
   ||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=32123

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


[Bug gas/32073] [2.44 Regression] gas failed to build x86-64 Linux kernel

2024-08-31 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32073

H.J. Lu  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
   Target Milestone|--- |2.44
 Resolution|--- |FIXED

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

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