[PATCH] D43712: [WebAssembly] Remove ELF-ness.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 19:46:29 PST 2018


ruiu created this revision.
ruiu added a reviewer: sbc100.
Herald added subscribers: sunfish, aheejin, jgravelle-google, dschuff, jfb.

These output section names are ELF-specific. We shouldn't have this rule
for WebAssembly.


https://reviews.llvm.org/D43712

Files:
  lld/wasm/Writer.cpp


Index: lld/wasm/Writer.cpp
===================================================================
--- lld/wasm/Writer.cpp
+++ lld/wasm/Writer.cpp
@@ -823,16 +823,12 @@
 static StringRef getOutputDataSegmentName(StringRef Name) {
   if (Config->Relocatable)
     return Name;
-
-  for (StringRef V :
-       {".text.", ".rodata.", ".data.rel.ro.", ".data.", ".bss.rel.ro.",
-        ".bss.", ".init_array.", ".fini_array.", ".ctors.", ".dtors.", ".tbss.",
-        ".gcc_except_table.", ".tdata.", ".ARM.exidx.", ".ARM.extab."}) {
-    StringRef Prefix = V.drop_back();
-    if (Name.startswith(V) || Name == Prefix)
-      return Prefix;
-  }
-
+  if (Name == ".text" || Name.startswith(".text."))
+    return ".text";
+  if (Name == ".data" || Name.startswith(".data."))
+    return ".data";
+  if (Name == ".bss" || Name.startswith(".bss."))
+    return ".bss";
   return Name;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43712.135769.patch
Type: text/x-patch
Size: 882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180224/85b482e2/attachment.bin>


More information about the llvm-commits mailing list