Add assembler fatal error for undefined assembler labels in COFF writer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247814 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner 2015-09-16 16:26:29 +00:00
parent 45acd3e931
commit cba458eecc
2 changed files with 9 additions and 0 deletions

View File

@ -710,6 +710,11 @@ void WinCOFFObjectWriter::recordRelocation(
Asm.getContext().reportFatalError(Fixup.getLoc(),
Twine("symbol '") + A.getName() +
"' can not be undefined");
if (A.isTemporary() && A.isUndefined()) {
Asm.getContext().reportFatalError(Fixup.getLoc(),
Twine("assembler label '") + A.getName() +
"' can not be undefined");
}
MCSection *Section = Fragment->getParent();

View File

@ -0,0 +1,4 @@
// RUN: not llvm-mc -filetype=obj -triple i386-pc-win32 %s 2>&1 | FileCheck %s
// CHECK: assembler label 'Lundefined' can not be undefined
.text
movl Lundefined, %eax