https://sourceware.org/bugzilla/show_bug.cgi?id=23825

Fangrui Song <i at maskray dot me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i at maskray dot me

--- Comment #6 from Fangrui Song <i at maskray dot me> ---
Drive-by comment coming from https://reviews.llvm.org/D70398 (I am a bit
reluctant to let the change land. The design choice made in gcc seems fairly
bad and I think there is still chance to fix it.)

Using the Local Exec TLS model for extern TLS variable accesses in
position-dependent code (-fno-pic) is rather camp. 

A few architectures that I checked:

i386: R_386_TLS_IE
ARM: R_ARM_TLS_IE32
MIPS: R_MIPS_TLS_GOTTPREL
AArch64: R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC
PowerPC32: R_PPC_GOT_TPREL16
PowerPC64: R_PPC64_GOT_TPREL16_LO_DS

It does seem that RISC-V is in its own camp. A copy relocated TLS variable
wastes a part of the TLS block for every thread. If we used the Initial Exec
TLS model for extern TLS variable accesses, we could teach the linker to relax
Initial Exec to Local Exec.

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

Reply via email to