MC: Use @IMGREL instead of @IMGREL32, which we can't parse
authorReid Kleckner <reid@kleckner.net>
Thu, 25 Sep 2014 02:09:18 +0000 (02:09 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 25 Sep 2014 02:09:18 +0000 (02:09 +0000)
Nico Rieck added support for this 32-bit COFF relocation some time ago
for Win64 stuff. It appears that as an oversight, the assembly output
used "foo"@IMGREL32 instead of "foo"@IMGREL, which is what we can parse.

Sadly, there were actually tests that took in IMGREL and put out
IMGREL32, and we didn't notice the inconsistency. Oh well. Now LLVM can
assemble it's own output with slightly more fidelity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218437 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCExpr.cpp
test/MC/COFF/ir-to-imgrel.ll
test/MC/X86/intel-syntax.s

index 992f0a756ca81485706c6f2adfba1d95fab5c800..c0396233c2749b03960aa2232632212ea41e823d 100644 (file)
@@ -273,7 +273,7 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
   case VK_Mips_CALL_LO16: return "CALL_LO16";
   case VK_Mips_PCREL_HI16: return "PCREL_HI16";
   case VK_Mips_PCREL_LO16: return "PCREL_LO16";
-  case VK_COFF_IMGREL32: return "IMGREL32";
+  case VK_COFF_IMGREL32: return "IMGREL";
   }
   llvm_unreachable("Invalid variant kind");
 }
index 39884d2a15ebadc82b713a7ac85a55de4107bc9c..dfc88b2a675266ca84ba80a98bcc70a4bb83f50c 100644 (file)
@@ -2,5 +2,5 @@
 
 @__ImageBase = external global i8
 
-; X64: .quad   "?x@@3HA"@IMGREL32
+; X64: .quad   "?x@@3HA"@IMGREL
 @"\01?x@@3HA" = global i64 sub nsw (i64 ptrtoint (i64* @"\01?x@@3HA" to i64), i64 ptrtoint (i8* @__ImageBase to i64)), align 8
index 325f64d533b1d9e5a9ea0baf3a67326cf6754f56..c027aa426f3b81b57658181c9f9b287fbb5ecfd3 100644 (file)
@@ -606,7 +606,7 @@ mov rcx, qword ptr [_g0 + 8]
 fadd   dword ptr "?half@?0??bar@@YAXXZ@4NA"
 fadd   dword ptr "?half@?0??bar@@YAXXZ@4NA"@IMGREL
 // CHECK: fadds   "?half@?0??bar@@YAXXZ@4NA"
-// CHECK: fadds   "?half@?0??bar@@YAXXZ@4NA"@IMGREL32
+// CHECK: fadds   "?half@?0??bar@@YAXXZ@4NA"@IMGREL
 
 inc qword ptr [rax]
 inc dword ptr [rax]