[llvm] [X86] Resolve FIXME: WinCOFFObjectWriter::RecordRelocation can emit PC-relative calls (PR #83877)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 4 13:35:59 PST 2024
https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/83877
>From e22b4102f99c27a34d4783e28a862bec770e0fc0 Mon Sep 17 00:00:00 2001
From: Rose <83477269+AtariDreams at users.noreply.github.com>
Date: Mon, 4 Mar 2024 12:37:11 -0500
Subject: [PATCH] [X86] Resolve FIXME: WinCOFFObjectWriter::RecordRelocation
can emit PC-relative calls
This has been true for a while now, but this check has not been removed.
---
llvm/lib/Target/X86/X86Subtarget.cpp | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index 07f535685e8f97..74d9b1bd327ea1 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -238,10 +238,7 @@ X86Subtarget::classifyGlobalFunctionReference(const GlobalValue *GV,
/// Return true if the subtarget allows calls to immediate address.
bool X86Subtarget::isLegalToCallImmediateAddr() const {
- // FIXME: I386 PE/COFF supports PC relative calls using IMAGE_REL_I386_REL32
- // but WinCOFFObjectWriter::RecordRelocation cannot emit them. Once it does,
- // the following check for Win32 should be removed.
- if (Is64Bit || isTargetWin32())
+ if (Is64Bit)
return false;
return isTargetELF() || TM.getRelocationModel() == Reloc::Static;
}
More information about the llvm-commits
mailing list