[llvm] r306573 - Fix PR33625.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 28 10:56:07 PDT 2017
Author: rafael
Date: Wed Jun 28 10:56:07 2017
New Revision: 306573
URL: http://llvm.org/viewvc/llvm-project?rev=306573&view=rev
Log:
Fix PR33625.
We were failing to convert this expression to pcrel.
Added:
llvm/trunk/test/MC/X86/signed-coff-pcrel.s
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp?rev=306573&r1=306572&r2=306573&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp Wed Jun 28 10:56:07 2017
@@ -44,7 +44,7 @@ unsigned X86WinCOFFObjectWriter::getRelo
const MCAsmBackend &MAB) const {
unsigned FixupKind = Fixup.getKind();
if (IsCrossSection) {
- if (FixupKind != FK_Data_4) {
+ if (FixupKind != FK_Data_4 && FixupKind != llvm::X86::reloc_signed_4byte) {
Ctx.reportError(Fixup.getLoc(), "Cannot represent this expression");
return COFF::IMAGE_REL_AMD64_ADDR32;
}
Added: llvm/trunk/test/MC/X86/signed-coff-pcrel.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/signed-coff-pcrel.s?rev=306573&view=auto
==============================================================================
--- llvm/trunk/test/MC/X86/signed-coff-pcrel.s (added)
+++ llvm/trunk/test/MC/X86/signed-coff-pcrel.s Wed Jun 28 10:56:07 2017
@@ -0,0 +1,12 @@
+// RUN: llvm-mc -triple i686-unknown-windows-msvc -filetype obj -o %t.o %s
+// RUN: llvm-objdump -r %t.o | FileCheck %s
+
+// CHECK: 00000004 IMAGE_REL_I386_REL32 twop32
+
+ .section .rdata,"rd"
+twop32:
+ .quad 0x41f0000000000000
+
+ .text
+0:
+ mulsd twop32-0b(%eax), %xmm1
More information about the llvm-commits
mailing list