Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lld/COFF/InputFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ void ObjFile::parseLazy() {
if (coffSym.isAbsolute() && ignoredSymbolName(name))
continue;
symtab.addLazyObject(this, name);
if (!lazy)
return;
i += coffSym.getNumberOfAuxSymbols();
}
}
Expand Down Expand Up @@ -1291,8 +1293,11 @@ void BitcodeFile::parse() {

void BitcodeFile::parseLazy() {
for (const lto::InputFile::Symbol &sym : obj->symbols())
if (!sym.isUndefined())
if (!sym.isUndefined()) {
symtab.addLazyObject(this, sym.getName());
if (!lazy)
return;
}
}

MachineTypes BitcodeFile::getMachineType() const {
Expand Down
30 changes: 24 additions & 6 deletions lld/test/COFF/start-lib.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,37 @@
; RUN: llc -filetype=obj %t.dir/main.ll -o %t.obj
; RUN: llc -filetype=obj %t.dir/start-lib1.ll -o %t1.obj
; RUN: llc -filetype=obj %t.dir/start-lib2.ll -o %t2.obj
; RUN: llc -filetype=obj %t.dir/eager.ll -o %t-eager.obj
; RUN: opt -thinlto-bc %t.dir/main.ll -o %t.bc
; RUN: opt -thinlto-bc %t.dir/start-lib1.ll -o %t1.bc
; RUN: opt -thinlto-bc %t.dir/start-lib2.ll -o %t2.bc
; RUN: opt -thinlto-bc %t.dir/eager.ll -o %t-eager.bc
;
; RUN: lld-link -out:%t1.exe -entry:main -opt:noref -lldmap:%t1.map \
; RUN: %t.obj %t1.obj %t2.obj
; RUN: %t.obj %t1.obj %t2.obj %t-eager.obj
; RUN: FileCheck --check-prefix=TEST1 %s < %t1.map
; RUN: lld-link -out:%t1.exe -entry:main -opt:noref -lldmap:%t1.thinlto.map \
; RUN: %t.bc %t1.bc %t2.bc
; RUN: %t.bc %t1.bc %t2.bc %t-eager.bc
; RUN: FileCheck --check-prefix=TEST1 %s < %t1.thinlto.map
; TEST1: foo
; TEST1: bar
;
; RUN: lld-link -out:%t2.exe -entry:main -opt:noref -lldmap:%t2.map \
; RUN: %t.obj -start-lib %t1.obj -end-lib %t2.obj
; RUN: %t.obj -start-lib %t1.obj %t-eager.obj -end-lib %t2.obj
; RUN: FileCheck --check-prefix=TEST2 %s < %t2.map
; RUN: lld-link -out:%t2.exe -entry:main -opt:noref -lldmap:%t2.thinlto.map \
; RUN: %t.bc -start-lib %t1.bc -end-lib %t2.bc
; RUN: %t.bc -start-lib %t1.bc %t-eager.bc -end-lib %t2.bc
; RUN: FileCheck --check-prefix=TEST2 %s < %t2.thinlto.map
; TEST2: Address Size Align Out In Symbol
; TEST2-NOT: {{ }}foo{{$}}
; TEST2: {{ }}bar{{$}}
; TEST2-NOT: {{ }}foo{{$}}
;
; RUN: lld-link -out:%t3.exe -entry:main -opt:noref -lldmap:%t3.map \
; RUN: %t.obj -start-lib %t1.obj %t2.obj
; RUN: %t.obj -start-lib %t1.obj %t2.obj %t-eager.obj
; RUN: FileCheck --check-prefix=TEST3 %s < %t3.map
; RUN: lld-link -out:%t3.exe -entry:main -opt:noref -lldmap:%t3.thinlto.map \
; RUN: %t.bc -start-lib %t1.bc %t2.bc
; RUN: %t.bc -start-lib %t1.bc %t2.bc %t-eager.bc
; RUN: FileCheck --check-prefix=TEST3 %s < %t3.thinlto.map
; TEST3: Address Size Align Out In Symbol
; TEST3-NOT: {{ }}foo{{$}}
Expand All @@ -46,7 +48,10 @@
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"

declare void @eager()

define void @main() {
call void @eager()
ret void
}

Expand Down Expand Up @@ -79,3 +84,16 @@ define i32 @bar() {

!llvm.linker.options = !{!0}
!0 = !{!"/INCLUDE:bar"}

#--- eager.ll

target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"

define void @eager() {
ret void
}

define i32 @ogre() {
ret i32 1
}
Loading