forked from OSchip/llvm-project
Never fetch members for weak undefined symbols.
We were still fetching them when the archive was seen first. We should experiment with just letting lazy symbols get to compare, it might be cleaner for ELF. llvm-svn: 249417
This commit is contained in:
parent
1b3341724c
commit
85a6e0f870
|
@ -222,6 +222,12 @@ template <class ELFT> void SymbolTable::resolve(SymbolBody *New) {
|
|||
|
||||
if (Lazy *L = dyn_cast<Lazy>(Existing)) {
|
||||
if (New->isUndefined()) {
|
||||
if (New->isWeak()) {
|
||||
// See the explanation in SymbolTable::addLazy
|
||||
L->setUsedInRegularObj();
|
||||
L->setWeak();
|
||||
return;
|
||||
}
|
||||
addMemberFile(L);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -30,4 +30,7 @@
|
|||
# RUN: lld -flavor gnu2 %tar %t -o %tout
|
||||
# RUN: llvm-nm %tout | FileCheck --check-prefix=AR-FIRST %s
|
||||
|
||||
# AR-FIRST: T _start
|
||||
# AR-FIRST: T _start
|
||||
# AR-FIRST-NEXT: w bar
|
||||
# AR-FIRST-NEXT: T end
|
||||
# AR-FIRST-NEXT: w foo
|
||||
|
|
Loading…
Reference in New Issue