[PATCH] D59012: [WebAssembly] LTO: Don't include bitcode-only symbols in the symtab
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 18:42:29 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355577: [WebAssembly] LTO: Don't include bitcode-only symbols in the symtab (authored by sbc, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D59012?vs=189538&id=189637#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59012/new/
https://reviews.llvm.org/D59012
Files:
lld/trunk/test/ELF/lto/relocatable.ll
lld/trunk/test/wasm/lto/relocatable.ll
lld/trunk/wasm/Writer.cpp
Index: lld/trunk/test/wasm/lto/relocatable.ll
===================================================================
--- lld/trunk/test/wasm/lto/relocatable.ll
+++ lld/trunk/test/wasm/lto/relocatable.ll
@@ -0,0 +1,27 @@
+; RUN: llvm-as %s -o %t1.o
+; RUN: wasm-ld %t1.o -r -o %t
+; RUN: llvm-readobj -symbols %t | FileCheck %s
+
+; CHECK: Symbols [
+; CHECK-NEXT: Symbol {
+; CHECK-NEXT: Name: foo
+; CHECK-NEXT: Type: FUNCTION (0x0)
+; CHECK-NEXT: Flags [ (0x0)
+; CHECK-NEXT: ]
+; CHECK-NEXT: ElementIndex: 0x0
+; CHECK-NEXT: }
+; CHECK-NEXT: ]
+
+target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
+target triple = "wasm32-unknown-unknown"
+
+define void @foo() {
+ call void @bar()
+ ret void
+}
+
+define internal void @bar() {
+ ret void
+}
+
+declare i32 @baz(...)
Index: lld/trunk/test/ELF/lto/relocatable.ll
===================================================================
--- lld/trunk/test/ELF/lto/relocatable.ll
+++ lld/trunk/test/ELF/lto/relocatable.ll
@@ -71,3 +71,5 @@
define internal void @bar() {
ret void
}
+
+declare i32 @baz(...)
Index: lld/trunk/wasm/Writer.cpp
===================================================================
--- lld/trunk/wasm/Writer.cpp
+++ lld/trunk/wasm/Writer.cpp
@@ -950,7 +950,7 @@
};
for (Symbol *Sym : Symtab->getSymbols())
- if (!Sym->isLazy())
+ if (Sym->IsUsedInRegularObj)
AddSymbol(Sym);
for (ObjFile *File : Symtab->ObjectFiles) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59012.189637.patch
Type: text/x-patch
Size: 1455 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190307/b345b256/attachment.bin>
More information about the llvm-commits
mailing list