diff options
-rw-r--r-- | lld/ELF/Target.cpp | 5 | ||||
-rw-r--r-- | lld/ELF/Writer.cpp | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index b8e689d4866..0c859aeec43 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -372,6 +372,8 @@ RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { switch (Type) { default: return R_ABS; + case R_386_TLS_LDM: + return R_TLSLD; case R_386_PLT32: case R_386_PC32: case R_386_GOTPC: @@ -673,12 +675,13 @@ RelExpr X86_64TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const { switch (Type) { default: return R_ABS; + case R_X86_64_TLSLD: + return R_TLSLD_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_TLSLD: case R_X86_64_TLSGD: return R_PC; case R_X86_64_GOT32: diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 058d7c1c8b4..d230bc351e9 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -293,7 +293,6 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, Out<ELFT>::RelaDyn->addReloc({Target->TlsModuleIndexRel, Out<ELFT>::Got, Out<ELFT>::Got->getTlsIndexOff(), false, nullptr, 0}); - Expr = Expr == R_PC ? R_TLSLD_PC : R_TLSLD; C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); return 1; } |