diff options
author | David Sehr <sehr@chromium.org> | 2012-11-01 16:00:43 -0700 |
---|---|---|
committer | David Sehr <sehr@chromium.org> | 2012-11-01 16:00:43 -0700 |
commit | 96cb06677afe87ea958bf986ca2b9fb87daa2da1 (patch) | |
tree | 910321f10f6d407384c5e7030fa1c1d5dbb5684a | |
parent | a5c3afd0e68afcca5dfabaa0850d88735e9f9493 (diff) |
Allow calls to absolute addresses
Reverts a LOCALMOD that incorrectly patched an upstream issue.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=3110
TEST=none
Review URL: https://codereview.chromium.org/11364030
-rw-r--r-- | lib/Target/X86/X86Subtarget.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 177dfa02b4..2653f958a5 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -161,9 +161,13 @@ bool X86Subtarget::IsLegalToCallImmediateAddr(const TargetMachine &TM) const { if (In64BitMode) return false; // @LOCALMOD-BEGIN - // Upstream LLVM bug fix // BUG= http://code.google.com/p/nativeclient/issues/detail?id=2367 - return isTargetELF() && TM.getRelocationModel() == Reloc::Static; + // For NaCl dynamic linking we do not want to generate a text relocation to + // an absolute address in PIC mode. Such a situation arises from + // test/CodeGen/X86/call-imm.ll with the default implementation. + // For other platforms we retain the default behavior. + return (isTargetELF() && !isTargetNaCl()) || + TM.getRelocationModel() == Reloc::Static; // @LOCALMOD-END } |