[llvm-branch-commits] [lld] cb77e87 - [WebAssembly][lld] Don't mark a file live from an undefine symbol

Derek Schuff via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 17 11:11:45 PST 2020


Author: Derek Schuff
Date: 2020-12-17T11:05:36-08:00
New Revision: cb77e877f8132b885fcac8b7532c58072537b9ed

URL: https://github.com/llvm/llvm-project/commit/cb77e877f8132b885fcac8b7532c58072537b9ed
DIFF: https://github.com/llvm/llvm-project/commit/cb77e877f8132b885fcac8b7532c58072537b9ed.diff

LOG: [WebAssembly][lld] Don't mark a file live from an undefine symbol

Live symbols should only cause the files in which they are defined
to become live.

For now this is only tested in emscripten: we're continuing
to work on reducing the test case further for an lld-style
unit test.

Differential Revision: https://reviews.llvm.org/D93472

Added: 
    

Modified: 
    lld/wasm/Symbols.cpp

Removed: 
    


################################################################################
diff  --git a/lld/wasm/Symbols.cpp b/lld/wasm/Symbols.cpp
index 9e41f7c6281d..aa3b6be8a9b8 100644
--- a/lld/wasm/Symbols.cpp
+++ b/lld/wasm/Symbols.cpp
@@ -137,7 +137,7 @@ bool Symbol::isLive() const {
 
 void Symbol::markLive() {
   assert(!isDiscarded());
-  if (file != NULL)
+  if (file != NULL && isDefined())
     file->markLive();
   if (auto *g = dyn_cast<DefinedGlobal>(this))
     g->global->live = true;


        


More information about the llvm-branch-commits mailing list