[lld] r266583 - Have getRelExpr return the final values for tls gd.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 17 18:29:15 PDT 2016
Author: rafael
Date: Sun Apr 17 20:29:15 2016
New Revision: 266583
URL: http://llvm.org/viewvc/llvm-project?rev=266583&view=rev
Log:
Have getRelExpr return the final values for tls gd.
Modified:
lld/trunk/ELF/Target.cpp
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=266583&r1=266582&r2=266583&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Sun Apr 17 20:29:15 2016
@@ -372,6 +372,8 @@ RelExpr X86TargetInfo::getRelExpr(uint32
switch (Type) {
default:
return R_ABS;
+ case R_386_TLS_GD:
+ return R_TLSGD;
case R_386_TLS_LDM:
return R_TLSLD;
case R_386_PLT32:
@@ -677,12 +679,13 @@ RelExpr X86_64TargetInfo::getRelExpr(uin
return R_ABS;
case R_X86_64_TLSLD:
return R_TLSLD_PC;
+ case R_X86_64_TLSGD:
+ return R_TLSGD_PC;
case R_X86_64_SIZE32:
case R_X86_64_SIZE64:
return R_SIZE;
case R_X86_64_PLT32:
case R_X86_64_PC32:
- case R_X86_64_TLSGD:
return R_PC;
case R_X86_64_GOT32:
return R_GOT;
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=266583&r1=266582&r2=266583&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Sun Apr 17 20:29:15 2016
@@ -317,13 +317,13 @@ static unsigned handleTlsRelocation(uint
Off + (uintX_t)sizeof(uintX_t), false,
&Body, 0});
}
- Expr = Expr == R_PC ? R_TLSGD_PC : R_TLSGD;
C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
return 1;
}
if (Body.isPreemptible()) {
- Expr = Expr == R_PC ? R_RELAX_TLS_GD_TO_IE_PC : R_RELAX_TLS_GD_TO_IE;
+ Expr =
+ Expr == R_TLSGD_PC ? R_RELAX_TLS_GD_TO_IE_PC : R_RELAX_TLS_GD_TO_IE;
C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
if (!Body.isInGot()) {
Out<ELFT>::Got->addEntry(Body);
More information about the llvm-commits
mailing list