[PATCH] D40614: Add .init_array support to Wasm LLD

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 05:28:07 PST 2017


ncw updated this revision to Diff 125113.
ncw added a comment.
Herald added a reviewer: modocache.

(Rebased.)

We probably need some move votes then to reach consensus. On the one hand, Dan's idea is maybe a bit cleaner for C/C++ in the long term. There should probably be a principle on how much we want to emulate ELF, which we would then stick to. Choosing not to implement support for `.fini_array` (`__attribute__((destructor))` on `exit()`) also seems a bit premature, although I admit it's probably hardly-used. Potentially a good number of Emscripten programs do call `exit()` though.

At the moment, LLD is far, far from being able to link "generic" Wasm files together. The entire model revolves around custom sections providing ELFy data defined in the "Tool conventions", so using a start section instead of `.init_array` really isn't going to a huge difference for generic tools that want to produce inputs for LLD to process. I can appreciate the desire to reduce the ELFyness of the conventions though.

Either way, we could still do this (smaller) change right now, and come back and do Dan's change later, once we've got C++ working.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40614

Files:
  include/llvm/ADT/Triple.h
  lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  lib/MC/WasmObjectWriter.cpp
  utils/lit/lit/TestRunner.py
  utils/lit/tests/Inputs/shtest-shell/check_path.py
  utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt
  utils/lit/tests/Inputs/shtest-shell/diff-error-1.txt
  utils/lit/tests/Inputs/shtest-shell/diff-error-2.txt
  utils/lit/tests/Inputs/shtest-shell/diff-error-3.txt
  utils/lit/tests/Inputs/shtest-shell/diff-error-4.txt
  utils/lit/tests/Inputs/shtest-shell/diff-error-5.txt
  utils/lit/tests/Inputs/shtest-shell/diff-error-6.txt
  utils/lit/tests/Inputs/shtest-shell/mkdir-error-0.txt
  utils/lit/tests/Inputs/shtest-shell/mkdir-error-1.txt
  utils/lit/tests/Inputs/shtest-shell/mkdir-error-2.txt
  utils/lit/tests/Inputs/shtest-shell/rm-error-0.txt
  utils/lit/tests/Inputs/shtest-shell/rm-error-1.txt
  utils/lit/tests/Inputs/shtest-shell/rm-error-2.txt
  utils/lit/tests/Inputs/shtest-shell/rm-error-3.txt
  utils/lit/tests/Inputs/shtest-shell/valid-shell.txt
  utils/lit/tests/max-failures.py
  utils/lit/tests/shtest-shell.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40614.125113.patch
Type: text/x-patch
Size: 25538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171201/acfecb19/attachment.bin>


More information about the llvm-commits mailing list