mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 18:33:22 +00:00
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:
parent
a593909c3d
commit
ada0f6a93e
@ -240,6 +240,11 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const {
|
|||||||
if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage())
|
if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage())
|
||||||
Res |= BasicSymbolRef::SF_Weak;
|
Res |= BasicSymbolRef::SF_Weak;
|
||||||
|
|
||||||
|
if (auto *Var = dyn_cast<GlobalVariable>(GV)) {
|
||||||
|
if (Var->getSection() == StringRef("llvm.metadata"))
|
||||||
|
Res |= BasicSymbolRef::SF_FormatSpecific;
|
||||||
|
}
|
||||||
|
|
||||||
return Res;
|
return Res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,3 +10,6 @@ entry:
|
|||||||
declare i32 @puts(i8* nocapture) nounwind
|
declare i32 @puts(i8* nocapture) nounwind
|
||||||
|
|
||||||
declare void @SomeOtherFunction(...)
|
declare void @SomeOtherFunction(...)
|
||||||
|
|
||||||
|
@var = global i32 0
|
||||||
|
@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @var to i8*)], section "llvm.metadata"
|
||||||
|
@ -18,6 +18,7 @@ RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
|
|||||||
BITCODE: U SomeOtherFunction
|
BITCODE: U SomeOtherFunction
|
||||||
BITCODE-NEXT: T main
|
BITCODE-NEXT: T main
|
||||||
BITCODE-NEXT: U puts
|
BITCODE-NEXT: U puts
|
||||||
|
BITCODE-NEXT: D var
|
||||||
|
|
||||||
|
|
||||||
Test we don't error with an archive with no symtab.
|
Test we don't error with an archive with no symtab.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user