diff --git a/lld/ELF/Arch/X86.cpp b/lld/ELF/Arch/X86.cpp --- a/lld/ELF/Arch/X86.cpp +++ b/lld/ELF/Arch/X86.cpp @@ -161,7 +161,7 @@ default: return Expr; case R_RELAX_TLS_GD_TO_IE: - return R_RELAX_TLS_GD_TO_IE_END; + return R_RELAX_TLS_GD_TO_IE_GOTPLT; case R_RELAX_TLS_GD_TO_LE: return R_RELAX_TLS_GD_TO_LE_NEG; } diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -632,7 +632,7 @@ case R_GOTPLTREL: return Sym.getVA(A) - In.GotPlt->getVA(); case R_GOTPLT: - case R_RELAX_TLS_GD_TO_IE_END: + case R_RELAX_TLS_GD_TO_IE_GOTPLT: return Sym.getGotVA() + A - In.GotPlt->getVA(); case R_TLSLD_GOT_OFF: case R_GOT_OFF: @@ -908,7 +908,7 @@ case R_RELAX_TLS_GD_TO_IE: case R_RELAX_TLS_GD_TO_IE_ABS: case R_RELAX_TLS_GD_TO_IE_GOT_OFF: - case R_RELAX_TLS_GD_TO_IE_END: + case R_RELAX_TLS_GD_TO_IE_GOTPLT: Target->relaxTlsGdToIe(BufLoc, Type, TargetVA); break; case R_PPC_CALL: diff --git a/lld/ELF/Relocations.h b/lld/ELF/Relocations.h --- a/lld/ELF/Relocations.h +++ b/lld/ELF/Relocations.h @@ -49,8 +49,8 @@ R_RELAX_GOT_PC_NOPIC, R_RELAX_TLS_GD_TO_IE, R_RELAX_TLS_GD_TO_IE_ABS, - R_RELAX_TLS_GD_TO_IE_END, R_RELAX_TLS_GD_TO_IE_GOT_OFF, + R_RELAX_TLS_GD_TO_IE_GOTPLT, R_RELAX_TLS_GD_TO_LE, R_RELAX_TLS_GD_TO_LE_NEG, R_RELAX_TLS_IE_TO_LE,