Have getRelExpr return the final values for tls gd.
llvm-svn: 266583
This commit is contained in:
parent
134cb5d30f
commit
df17277d72
|
@ -372,6 +372,8 @@ RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
|
||||||
switch (Type) {
|
switch (Type) {
|
||||||
default:
|
default:
|
||||||
return R_ABS;
|
return R_ABS;
|
||||||
|
case R_386_TLS_GD:
|
||||||
|
return R_TLSGD;
|
||||||
case R_386_TLS_LDM:
|
case R_386_TLS_LDM:
|
||||||
return R_TLSLD;
|
return R_TLSLD;
|
||||||
case R_386_PLT32:
|
case R_386_PLT32:
|
||||||
|
@ -677,12 +679,13 @@ RelExpr X86_64TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
|
||||||
return R_ABS;
|
return R_ABS;
|
||||||
case R_X86_64_TLSLD:
|
case R_X86_64_TLSLD:
|
||||||
return R_TLSLD_PC;
|
return R_TLSLD_PC;
|
||||||
|
case R_X86_64_TLSGD:
|
||||||
|
return R_TLSGD_PC;
|
||||||
case R_X86_64_SIZE32:
|
case R_X86_64_SIZE32:
|
||||||
case R_X86_64_SIZE64:
|
case R_X86_64_SIZE64:
|
||||||
return R_SIZE;
|
return R_SIZE;
|
||||||
case R_X86_64_PLT32:
|
case R_X86_64_PLT32:
|
||||||
case R_X86_64_PC32:
|
case R_X86_64_PC32:
|
||||||
case R_X86_64_TLSGD:
|
|
||||||
return R_PC;
|
return R_PC;
|
||||||
case R_X86_64_GOT32:
|
case R_X86_64_GOT32:
|
||||||
return R_GOT;
|
return R_GOT;
|
||||||
|
|
|
@ -317,13 +317,13 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
|
||||||
Off + (uintX_t)sizeof(uintX_t), false,
|
Off + (uintX_t)sizeof(uintX_t), false,
|
||||||
&Body, 0});
|
&Body, 0});
|
||||||
}
|
}
|
||||||
Expr = Expr == R_PC ? R_TLSGD_PC : R_TLSGD;
|
|
||||||
C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
|
C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Body.isPreemptible()) {
|
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});
|
C.Relocations.push_back({Expr, Type, Offset, Addend, &Body});
|
||||||
if (!Body.isInGot()) {
|
if (!Body.isInGot()) {
|
||||||
Out<ELFT>::Got->addEntry(Body);
|
Out<ELFT>::Got->addEntry(Body);
|
||||||
|
|
Loading…
Reference in New Issue