Skip to content

Commit 084def0

Browse files
committed
[lld][ELF] Add --why-extract for bitcode libcalls
The Wasm linker already records these and its seems useful to do so.
1 parent f5e58a0 commit 084def0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lld/ELF/Driver.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,8 +2081,11 @@ static void handleUndefinedGlob(StringRef arg) {
20812081

20822082
static void handleLibcall(StringRef name) {
20832083
Symbol *sym = symtab.find(name);
2084-
if (sym && sym->isLazy() && isa<BitcodeFile>(sym->file))
2084+
if (sym && sym->isLazy() && isa<BitcodeFile>(sym->file)) {
2085+
if (!config->whyExtract.empty())
2086+
ctx.whyExtractRecords.emplace_back("<libcall>", sym->file, *sym);
20852087
sym->extract();
2088+
}
20862089
}
20872090

20882091
static void writeArchiveStats() {

0 commit comments

Comments
 (0)