On Fri, Sep 12, 2025 at 8:18 AM H.J. Lu <[email protected]> wrote:

> On Fri, Sep 12, 2025 at 7:50 AM Joseph Myers <[email protected]> wrote:
>
>> This breaks building glibc with linker errors for some configurations in
>> build-many-glibcs.py (loongarch64-linux-gnuf64 loongarch64-linux-gnusf
>> m68k-linux-gnu-coldfire m68k-linux-gnu-coldfire-soft or1k-linux-gnu).
>>
>> Representative linker errors are as follows.  Of course assertion
>> failures
>> indicate a linker bug as well, but if there really are mixtures of TLS
>> and
>> non-TLS references to the same symbol as suggested by the or1k-linux-gnu
>
>
> How does mixing TLS and non-TLS references of the same symbol work?
> X86 linker issues an error if it happens.  It sounds like a glibc bug.
>
>
 [hjl@gnu-cfl-3 tmp]$ cat x.s
.text
.p2align 4
.globl foo
.type foo, @function
foo:
.LFB0:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
movq x@GOTPCREL(%rip), %rdx
leaq x@TLSDESC(%rip), %rax
call *x@TLSCALL(%rax)
movl (%rdx), %edx
addl %fs:(%rax), %edx
addq $8, %rsp
.cfi_def_cfa_offset 8
movl %edx, %eax
ret
.cfi_endproc
.LFE0:
.size foo, .-foo
.section .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-3 tmp]$ gcc -c x.s
[hjl@gnu-cfl-3 tmp]$ ld -shared -o x.so x.o
ld: x.o: 'x' accessed both as normal and thread local symbol
ld: failed to set dynamic section sizes: bad value
[hjl@gnu-cfl-3 tmp]$


>> errors, that suggests something wrong with this patch.
>>
>>
>>
>
> --
> H.J.
>


-- 
H.J.

Reply via email to