forked from OSchip/llvm-project
ELF: Exclude dead symbols from -Map output.
This was previously erroring out if one of the dead symbols was a TLS symbol and we were able to discard all TLS sections. Differential Revision: https://reviews.llvm.org/D35397 llvm-svn: 307984
This commit is contained in:
parent
3e2abdef02
commit
b069a36f27
|
@ -55,7 +55,7 @@ template <class ELFT> std::vector<DefinedRegular *> getSymbols() {
|
||||||
for (SymbolBody *B : File->getSymbols())
|
for (SymbolBody *B : File->getSymbols())
|
||||||
if (B->File == File && !B->isSection())
|
if (B->File == File && !B->isSection())
|
||||||
if (auto *Sym = dyn_cast<DefinedRegular>(B))
|
if (auto *Sym = dyn_cast<DefinedRegular>(B))
|
||||||
if (Sym->Section)
|
if (Sym->Section && Sym->Section->Live)
|
||||||
V.push_back(Sym);
|
V.push_back(Sym);
|
||||||
return V;
|
return V;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||||
|
// RUN: ld.lld %t.o -o %t -Map=- --gc-sections | FileCheck %s
|
||||||
|
|
||||||
|
.section .tbss,"awT",@nobits
|
||||||
|
// CHECK-NOT: foo
|
||||||
|
.globl foo
|
||||||
|
foo:
|
||||||
|
.align 8
|
||||||
|
.long 0
|
Loading…
Reference in New Issue