diff options
-rw-r--r-- | lld/ELF/InputSection.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/Target.cpp | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 4dc3252e8da..5552b90d319 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -168,10 +168,10 @@ getSymVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P, case R_GOTREL: return Body.getVA<ELFT>(A) - Out<ELFT>::Got->getVA(); case R_GOT_FROM_END: + case R_RELAX_TLS_GD_TO_IE: return Body.getGotOffset<ELFT>() + A - Out<ELFT>::Got->getNumEntries() * sizeof(uintX_t); case R_GOT: - case R_RELAX_TLS_GD_TO_IE: return Body.getGotVA<ELFT>() + A; case R_GOT_PAGE_PC: return getAArch64Page(Body.getGotVA<ELFT>() + A) - getAArch64Page(P); diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 6fb09a5ff41..8bbdfd28f6f 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -416,8 +416,7 @@ void X86TargetInfo::relaxTlsGdToIe(uint8_t *Loc, uint32_t Type, 0x03, 0x83, 0x00, 0x00, 0x00, 0x00 // addl 0(%ebx), %eax }; memcpy(Loc - 3, Inst, sizeof(Inst)); - relocateOne(Loc + 5, R_386_32, Val - Out<ELF32LE>::Got->getVA() - - Out<ELF32LE>::Got->getNumEntries() * 4); + relocateOne(Loc + 5, R_386_32, Val); } // In some conditions, relocations can be optimized to avoid using GOT. |