[PATCH] D92950: [WebAssembly] [lld] Exclude COMDAT sections

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 14:53:41 PST 2020


dschuff created this revision.
Herald added subscribers: sunfish, jgravelle-google, sbc100.
dschuff updated this revision to Diff 310973.
dschuff added a comment.
dschuff updated this revision to Diff 310981.
dschuff updated this revision to Diff 311033.
dschuff retitled this revision from "[WIP] WebAssembly Linker change for COMDAT sections" to "WebAssembly Linker change for COMDAT sections".
dschuff edited the summary of this revision.
dschuff retitled this revision from "WebAssembly Linker change for COMDAT sections" to "[WebAssembly] [lld] Exclude COMDAT sections".
dschuff edited the summary of this revision.
Herald added a subscriber: ecnelises.
dschuff published this revision for review.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

- add tests


dschuff added a comment.

- update. sections seem to work, functions fishy


sbc100 added a comment.

lgtm... Aside from the broken test.


dschuff added a comment.

- rebase, remove debug print and don't test functions



================
Comment at: lld/wasm/InputFiles.cpp:439
+               << chunk->getName() << " comdat " << c << " excluded "
+               << !keptComdats[c] << "\n";
   return !keptComdats[c];
----------------
Remove debugging?


================
Comment at: lld/wasm/InputFiles.cpp:498
+    // Need to return null if discarded here? data and func only do that when
+    // binding is not local.
+    if (section->discarded)
----------------
But the assert above shows that all section symbols are by definition local binding.    You can't ever reference section symbol from another object file.. they are always internal to given object.


Allow exclusion/discarding of custom sections with COMDAT groups.
It piggybacks on the existing COMDAT-handling code, but applies to custom sections as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92950

Files:
  lld/test/wasm/Inputs/comdat1.s
  lld/test/wasm/Inputs/comdat2.s
  lld/test/wasm/comdat-sections.s
  lld/wasm/InputChunks.h
  lld/wasm/InputFiles.cpp
  lld/wasm/OutputSections.cpp
  lld/wasm/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92950.311033.patch
Type: text/x-patch
Size: 5297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201210/c4f81c07/attachment.bin>


More information about the llvm-commits mailing list