[PATCH] D42511: [WebAssembly] Add support for --gc-sections

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 16:20:05 PST 2018


ncw added a comment.

As well as Types, I mentioned GC for Imports above as well. It would be very useful to be able to reduce the number of dependencies/imports of the module based on dead code - it's not just a size improvement.

For types, it's annoying, yes, I hadn't thought about it at all, but they do need to pruned via GC don't they. It's tempting to think that type relocations can only appear as the operand of instructions like call_indirect, and those must be pointing to either a defined or imported function - but it's not true, you could write code that does a call_indirect to the null function index using a type that otherwise wouldn't exist in the module at all. (Do we have a test for that?) So we really do have to look at the relocations before pruning the types.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42511





More information about the llvm-commits mailing list