Fix another case of propagating IsUsedRegularObj.
I have an idea on how to clean this up, but lets get the tests passing first. llvm-svn: 265374
This commit is contained in:
parent
c393c028a9
commit
5cea969dca
|
@ -228,7 +228,8 @@ template <class ELFT> void SymbolTable<ELFT>::resolve(SymbolBody *New) {
|
|||
}
|
||||
// Found a definition for something also in an archive.
|
||||
// Ignore the archive definition.
|
||||
New->setUsedInRegularObj();
|
||||
if (L->isUsedInRegularObj())
|
||||
New->setUsedInRegularObj();
|
||||
Sym->Body = New;
|
||||
return;
|
||||
}
|
||||
|
@ -282,6 +283,8 @@ template <class ELFT> void SymbolTable<ELFT>::addLazy(Lazy *L) {
|
|||
|
||||
template <class ELFT>
|
||||
void SymbolTable<ELFT>::addMemberFile(Undefined *Undef, Lazy *L) {
|
||||
if (Undef->isUsedInRegularObj())
|
||||
L->setUsedInRegularObj();
|
||||
// Weak undefined symbols should not fetch members from archives.
|
||||
// If we were to keep old symbol we would not know that an archive member was
|
||||
// available if a strong undefined symbol shows up afterwards in the link.
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
define void @foo() {
|
||||
ret void
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
; REQUIRES: x86
|
||||
; RUN: llvm-as %S/Inputs/archive-3.ll -o %t1.o
|
||||
; RUN: llvm-as %s -o %t2.o
|
||||
|
||||
; RUN: ld.lld -m elf_x86_64 %t1.o %t2.o -o %t3 -save-temps
|
||||
; RUN: llvm-dis %t3.lto.bc -o - | FileCheck %s
|
||||
|
||||
; RUN: rm -f %t.a
|
||||
; RUN: llvm-ar rcs %t.a %t1.o
|
||||
; RUN: ld.lld -m elf_x86_64 %t.a %t1.o %t2.o -o %t3 -save-temps
|
||||
; RUN: llvm-dis %t3.lto.bc -o - | FileCheck %s
|
||||
|
||||
; CHECK: define internal void @foo() {
|
||||
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
define void @_start() {
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue