File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2114,8 +2114,11 @@ static void handleUndefinedGlob(StringRef arg) {
2114
2114
2115
2115
static void handleLibcall (StringRef name) {
2116
2116
Symbol *sym = symtab.find (name);
2117
- if (sym && sym->isLazy () && isa<BitcodeFile>(sym->file ))
2117
+ if (sym && sym->isLazy () && isa<BitcodeFile>(sym->file )) {
2118
+ if (!config->whyExtract .empty ())
2119
+ ctx.whyExtractRecords .emplace_back (" <libcall>" , sym->file , *sym);
2118
2120
sym->extract ();
2121
+ }
2119
2122
}
2120
2123
2121
2124
static void writeArchiveStats () {
Original file line number Diff line number Diff line change 4
4
; RUN: llvm-as -o %t2.o %S/Inputs/libcall-archive.ll
5
5
; RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux -o %t3.o %S/Inputs/libcall-archive.s
6
6
; RUN: llvm-ar rcs %t.a %t2.o %t3.o
7
- ; RUN: ld.lld -o %t %t.o %t.a
7
+ ; RUN: ld.lld --why-extract=why.txt -o %t %t.o %t.a
8
+ ; RUN: FileCheck %s --input-file=why.txt --check-prefix=CHECK-WHY
8
9
; RUN: llvm-nm %t | FileCheck %s
9
10
; RUN: ld.lld -o %t2 %t.o --start-lib %t2.o %t3.o --end-lib
10
11
; RUN: llvm-nm %t2 | FileCheck %s
11
12
13
+ ; CHECK-WHY: reference extracted symbol
14
+ ; CHECK-WHY-NEXT: <libcall> {{.*}}tmp.a({{.*}}tmp2.o) memcpy
15
+
12
16
; CHECK-NOT: T __sync_val_compare_and_swap_8
13
17
; CHECK: T _start
14
18
; CHECK: T memcpy
You can’t perform that action at this time.
0 commit comments