[PATCH] D64947: [WebAssembly] fix bug in finding .tdata segment

Guanzhong Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 13:43:08 PDT 2019


quantum created this revision.
quantum added reviewers: tlively, aheejin, sbc100.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, dschuff.
Herald added a project: LLVM.

Fix bug in `wasm-ld`'s `Writer::createInitTLSFunction` that only finds `.tdata` if it's the first section.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64947

Files:
  lld/wasm/Writer.cpp


Index: lld/wasm/Writer.cpp
===================================================================
--- lld/wasm/Writer.cpp
+++ lld/wasm/Writer.cpp
@@ -771,9 +771,10 @@
 
     OutputSegment *tlsSeg = nullptr;
     for (auto *seg : segments) {
-      if (seg->name == ".tdata")
+      if (seg->name == ".tdata") {
         tlsSeg = seg;
-      break;
+        break;
+      }
     }
 
     writeUleb128(os, 0, "num locals");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64947.210660.patch
Type: text/x-patch
Size: 419 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190718/35236e68/attachment.bin>


More information about the llvm-commits mailing list