Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp

Issue 18261008: PNaCl: Fix negative relocation addends on x86-32 (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/NaCl/ARM/negative-addend.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
diff --git a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
index 613edb00b5add4e71a360fc540731dc560cb5bbd..7c1ebd1d3f4c42a6cca5616cec746a3b70a24f15 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));
« no previous file with comments | « no previous file | test/NaCl/ARM/negative-addend.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698