Weak undefined symbols should not fetch archive members.
llvm-svn: 249160
This commit is contained in:
parent
e9021117a1
commit
b2a5cafb37
|
@ -226,7 +226,7 @@ void SymbolTable::addLazy(Lazy *New) {
|
|||
if (Sym->Body == New)
|
||||
return;
|
||||
SymbolBody *Existing = Sym->Body;
|
||||
if (Existing->isDefined() || Existing->isLazy())
|
||||
if (Existing->isDefined() || Existing->isLazy() || Existing->isWeak())
|
||||
return;
|
||||
Sym->Body = New;
|
||||
assert(Existing->isUndefined() && "Unexpected symbol kind.");
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
.global foo
|
||||
foo:
|
|
@ -1,6 +1,7 @@
|
|||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/archive.s -o %t2
|
||||
# RUN: llvm-ar rcs %tar %t2
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/archive2.s -o %t3
|
||||
# RUN: llvm-ar rcs %tar %t2 %t3
|
||||
# RUN: lld -flavor gnu2 %t %tar -o %tout
|
||||
# RUN: llvm-nm %tout | FileCheck %s
|
||||
# REQUIRES: x86
|
||||
|
@ -9,5 +10,9 @@
|
|||
|
||||
.quad end
|
||||
|
||||
.weak foo
|
||||
.quad foo
|
||||
|
||||
# CHECK: T _start
|
||||
# CHECK: T end
|
||||
# CHECK: w foo
|
||||
|
|
Loading…
Reference in New Issue