https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84010
--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > There are similar problems for other TLS models which can be relaxed, but > even worse than this, local dynamic uses a sethi/xor for the offset from the > defining module's block to load a signed 32-bit value, but since it's marked > as SI I assume a spill/reload will truncate the top 32 bits and thus lose > any sign extension if it's negative, breaking it even with linker relaxation > disabled. It turns out that this sethi/xor pair cannot generate a negative value according to the calculation formulas of R_SPARC_TLS_LDO_HIX22 & R_SPARC_TLS_LDO_LOX10 available at https://docs.oracle.com/cd/E37838_01/html/E36783/man-tlsam.html So, if the above formulas are incorrect, relaxation is required in all cases.