summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86CodeEmitter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-08-12 18:23:48 +0000
committerDale Johannesen <dalej@apple.com>2008-08-12 18:23:48 +0000
commitec867a22b3b3e131187e105b3639bcf5eb101590 (patch)
treea9a2b5d6a3ea6bfe1e07048c7a9761ba669d6b30 /lib/Target/X86/X86CodeEmitter.cpp
parent04f4f4f447806cd92a2fb6f4b66d11f6d5003a82 (diff)
downloadllvm-ec867a22b3b3e131187e105b3639bcf5eb101590.tar.gz
llvm-ec867a22b3b3e131187e105b3639bcf5eb101590.tar.bz2
llvm-ec867a22b3b3e131187e105b3639bcf5eb101590.tar.xz
In the absence of a linker to build the GOT, use the 32-bit
non_lazy_ptr mechanism on x86-64 Darwin JIT. Fixes a bunch of last night's failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86CodeEmitter.cpp')
-rw-r--r--lib/Target/X86/X86CodeEmitter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp
index c0d051fcef..8a02ca4b75 100644
--- a/lib/Target/X86/X86CodeEmitter.cpp
+++ b/lib/Target/X86/X86CodeEmitter.cpp
@@ -251,7 +251,9 @@ static bool isDisp8(int Value) {
}
bool Emitter::gvNeedsLazyPtr(const GlobalValue *GV) {
- return !Is64BitMode &&
+ // For Darwin, simulate the linktime GOT by using the same lazy-pointer
+ // mechanism as 32-bit mode.
+ return (!Is64BitMode || TM.getSubtarget<X86Subtarget>().isTargetDarwin()) &&
TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
}