Fix a crash when producing COFF.

llvm-svn: 271229
This commit is contained in:
Rafael Espindola 2016-05-30 20:18:53 +00:00
parent d788c9d83d
commit 4f1062adb8
2 changed files with 8 additions and 0 deletions

View File

@ -53,6 +53,8 @@ unsigned X86WinCOFFObjectWriter::getRelocType(const MCValue &Target,
case FK_PCRel_4:
case X86::reloc_riprel_4byte:
case X86::reloc_riprel_4byte_movq_load:
case X86::reloc_riprel_4byte_relax:
case X86::reloc_riprel_4byte_relax_rex:
return COFF::IMAGE_REL_AMD64_REL32;
case FK_Data_4:
case X86::reloc_signed_4byte:

View File

@ -0,0 +1,6 @@
// RUN: llvm-mc %s -o %t -filetype=obj -triple=x86_64-pc-win32
// Don't crash trying to create relaxable relocations on COFF.
add bar(%rip), %rax
call *bar(%rip)