[ELF] Simplify R_386_TLS_GD computation. NFC
authorFangrui Song <i@maskray.me>
Sat, 17 Apr 2021 02:08:23 +0000 (19:08 -0700)
committerFangrui Song <i@maskray.me>
Sat, 17 Apr 2021 02:08:23 +0000 (19:08 -0700)
lld/ELF/InputSection.cpp

index 0ee1b08..17fa7db 100644 (file)
@@ -839,7 +839,7 @@ uint64_t InputSectionBase::getRelocTargetVA(const InputFile *file, RelType type,
   case R_TLSGD_GOT:
     return in.got->getGlobalDynOffset(sym) + a;
   case R_TLSGD_GOTPLT:
-    return in.got->getVA() + in.got->getGlobalDynOffset(sym) + a - in.gotPlt->getVA();
+    return in.got->getGlobalDynAddr(sym) + a - in.gotPlt->getVA();
   case R_TLSGD_PC:
     return in.got->getGlobalDynAddr(sym) + a - p;
   case R_TLSLD_GOTPLT: