[AArch64] Delete unneeded fixup_aarch64_ldr_pcrel_imm19 VK_GOT special case
authorFangrui Song <i@maskray.me>
Sun, 23 May 2021 22:20:56 +0000 (15:20 -0700)
committerFangrui Song <i@maskray.me>
Sun, 23 May 2021 22:20:56 +0000 (15:20 -0700)
An AArch64 VK_GOT fixup must have a symbol. MCAssembler::evaluateFixup considers
such a fixup not resolved. The code path cannot trigger.

llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp

index 02570e8..290fe88 100644 (file)
@@ -491,13 +491,6 @@ bool AArch64AsmBackend::shouldForceRelocation(const MCAssembler &Asm,
   if (Kind == AArch64::fixup_aarch64_pcrel_adrp_imm21)
     return true;
 
-  AArch64MCExpr::VariantKind RefKind =
-      static_cast<AArch64MCExpr::VariantKind>(Target.getRefKind());
-  AArch64MCExpr::VariantKind SymLoc = AArch64MCExpr::getSymbolLoc(RefKind);
-  // LDR GOT relocations need a relocation
-  if (Kind == AArch64::fixup_aarch64_ldr_pcrel_imm19 &&
-      SymLoc == AArch64MCExpr::VK_GOT)
-    return true;
   return false;
 }