[PATCH] D92997: [lld][WebAssembly] Don't emit names for data segments that we omit

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 21:00:30 PST 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd8ed639a6a3b: [lld][WebAssembly] Don't emit names for data segments that we omit (authored by sbc100).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92997/new/

https://reviews.llvm.org/D92997

Files:
  lld/test/wasm/bss-only.s
  lld/wasm/SyntheticSections.cpp


Index: lld/wasm/SyntheticSections.cpp
===================================================================
--- lld/wasm/SyntheticSections.cpp
+++ lld/wasm/SyntheticSections.cpp
@@ -566,7 +566,7 @@
   unsigned numNames = 0;
 
   for (const OutputSegment *s : segments)
-    if (!s->name.empty())
+    if (!s->name.empty() && !s->isBss)
       ++numNames;
 
   return numNames;
@@ -636,8 +636,10 @@
     writeUleb128(sub.os, count, "name count");
 
     for (OutputSegment *s : segments) {
-      writeUleb128(sub.os, s->index, "global index");
-      writeStr(sub.os, s->name, "segment name");
+      if (!s->name.empty() && !s->isBss) {
+        writeUleb128(sub.os, s->index, "global index");
+        writeStr(sub.os, s->name, "segment name");
+      }
     }
 
     sub.writeTo(bodyOutputStream);
Index: lld/test/wasm/bss-only.s
===================================================================
--- lld/test/wasm/bss-only.s
+++ lld/test/wasm/bss-only.s
@@ -41,3 +41,5 @@
 # CHECK-NEXT:       - Name:            __data_end
 # CHECK-NEXT:         Kind:            GLOBAL
 # CHECK-NEXT:         Index:           1
+
+# CHECK-NOT: DataSegmentNames:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92997.310759.patch
Type: text/x-patch
Size: 1149 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201210/9255008b/attachment.bin>


More information about the llvm-commits mailing list