Produce an error for an invalid use of .symver.

llvm-svn: 117462
This commit is contained in:
Rafael Espindola 2010-10-27 17:56:18 +00:00
parent ba1c6cd62f
commit 26496e6835
2 changed files with 12 additions and 0 deletions

View File

@ -468,6 +468,11 @@ void ELFObjectWriterImpl::ExecutePostLayoutBinding(MCAssembler &Asm) {
if (!Symbol.isUndefined() && !Rest.startswith("@@@"))
continue;
// FIXME: produce a better error message.
if (Symbol.isUndefined() && Rest.startswith("@@") &&
!Rest.startswith("@@@"))
report_fatal_error("A @@ version cannot be undefined");
std::pair<const MCSymbol *, const MCSymbol *> t(&Symbol, &Alias);
Renames.insert(t);
}

View File

@ -0,0 +1,7 @@
// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t 2> %t.out
// RUN: FileCheck --input-file=%t.out %s
// CHECK: A @@ version cannot be undefined
.symver undefined, foo@@bar
.long undefined