[llvm] r189543 - The darwin integrated assembler for X86 in 64-bit mode is not rejecting
Kevin Enderby
enderby at apple.com
Wed Aug 28 17:19:03 PDT 2013
Author: enderby
Date: Wed Aug 28 19:19:03 2013
New Revision: 189543
URL: http://llvm.org/viewvc/llvm-project?rev=189543&view=rev
Log:
The darwin integrated assembler for X86 in 64-bit mode is not rejecting
32-bit absolute addressing in instructions likei this:
mov $_f, %rsi
which is not supported in 64-bit mode.
rdar://8827134
Added:
llvm/trunk/test/MC/MachO/bad-darwin-x86_64-32-bit-abs-addr.s
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp?rev=189543&r1=189542&r2=189543&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp Wed Aug 28 19:19:03 2013
@@ -323,8 +323,13 @@ void X86MachObjectWriter::RecordX86_64Re
report_fatal_error("TLVP symbol modifier should have been rip-rel");
} else if (Modifier != MCSymbolRefExpr::VK_None)
report_fatal_error("unsupported symbol modifier in relocation");
- else
+ else {
Type = macho::RIT_X86_64_Unsigned;
+ unsigned Kind = Fixup.getKind();
+ if (Kind == X86::reloc_signed_4byte)
+ report_fatal_error("32-bit absolute addressing is not supported in "
+ "64-bit mode");
+ }
}
}
Added: llvm/trunk/test/MC/MachO/bad-darwin-x86_64-32-bit-abs-addr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/bad-darwin-x86_64-32-bit-abs-addr.s?rev=189543&view=auto
==============================================================================
--- llvm/trunk/test/MC/MachO/bad-darwin-x86_64-32-bit-abs-addr.s (added)
+++ llvm/trunk/test/MC/MachO/bad-darwin-x86_64-32-bit-abs-addr.s Wed Aug 28 19:19:03 2013
@@ -0,0 +1,5 @@
+// RUN: not llvm-mc -triple x86_64-apple-darwin10 %s -filetype=obj -o - 2> %t.err > %t
+// RUN: FileCheck --check-prefix=CHECK-ERROR < %t.err %s
+
+mov $_f, %rsi
+// CHECK-ERROR: 32-bit absolute addressing is not supported in 64-bit mode
More information about the llvm-commits
mailing list