aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-07-09 11:02:56 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-07-09 11:02:56 -0700
commitaf49991972c1ca2364cd7377f4781893ffb3ffc5 (patch)
tree8dfd6ea97b0edc31e0771c2933df3f936956280a /lib
parentd7676885204bbc165a8b27a537777bfe450e6323 (diff)
PNaCl: Fix negative relocation addends on x86-32
Disable an assertion. This assertion made the behaviour on x86-32 inconsistent with x86-64 and ARM. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3548 TEST=*.ll tests + PNaCl toolchain trybots Review URL: https://codereview.chromium.org/18261008
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
index 613edb00b5..7c1ebd1d3f 100644
--- a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
+++ b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
@@ -99,12 +99,19 @@ public:
assert(Fixup.getOffset() + Size <= DataSize &&
"Invalid fixup offset!");
+ // @LOCALMOD-BEGIN
+ // This check breaks negative addends on x86-32. It makes x86-32
+ // behaviour inconsistent with x86-64 and ARM.
+ // See: https://code.google.com/p/nativeclient/issues/detail?id=3548
+#if 0
// Check that uppper bits are either all zeros or all ones.
// Specifically ignore overflow/underflow as long as the leakage is
// limited to the lower bits. This is to remain compatible with
// other assemblers.
assert(isIntN(Size * 8 + 1, Value) &&
"Value does not fit in the Fixup field");
+#endif
+ // @LOCALMOD-END
for (unsigned i = 0; i != Size; ++i)
Data[Fixup.getOffset() + i] = uint8_t(Value >> (i * 8));