Don't include llvm.metadata variables in archive symbol tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-07-04 15:03:17 +00:00
parent a593909c3d
commit ada0f6a93e
3 changed files with 9 additions and 0 deletions

View File

@ -240,6 +240,11 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const {
if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage())
Res |= BasicSymbolRef::SF_Weak;
if (auto *Var = dyn_cast<GlobalVariable>(GV)) {
if (Var->getSection() == StringRef("llvm.metadata"))
Res |= BasicSymbolRef::SF_FormatSpecific;
}
return Res;
}

View File

@ -10,3 +10,6 @@ entry:
declare i32 @puts(i8* nocapture) nounwind
declare void @SomeOtherFunction(...)
@var = global i32 0
@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @var to i8*)], section "llvm.metadata"

View File

@ -18,6 +18,7 @@ RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
BITCODE: U SomeOtherFunction
BITCODE-NEXT: T main
BITCODE-NEXT: U puts
BITCODE-NEXT: D var
Test we don't error with an archive with no symtab.