<div dir="ltr">Can you link to docs about the wasm object format? (both relocatable and executable)<div><br></div><div>Also, traditional object file linkers are primarily concerned with concatenating binary blobs with small amount of patching of said binary blobs based on computed virtual (memory) addresses. Or perhaps to put it another way, what traditional object file linkers do is construct program images meant to be mapped directly into memory.</div><div><br></div><div>My understanding is that wasm is pretty different from this (though "linker frontend" things like the symbol resolution process is presumably similar). Looking at Writer::run in your patch it seems like wasm is indeed very different. E.g. the linker is aware of things like "types" and knowing internal structure of functions (e.g. write_sig knows about how many parameters a function has)</div><div><br></div><div>Can you elaborate on semantically what the linker is actually doing for wasm?</div><div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 30, 2017 at 4:46 PM, Sam Clegg via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi llvmers,<br>
<br>
As you may know, work has been progressing on the experimental<br>
WebAssembly backend in llvm. However, there is currently not a good<br>
linking story. Most the of existing linking strategies (i.e. those in<br>
the emscripten toolchain) involve bitcode linking and whole program<br>
compilation at link time.<br>
<br>
To improve this situation I've been working on adding a wasm backend<br>
for lld. My current work is here: <a href="https://reviews.llvm.org/D34851" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D34851</a><br>
<br>
Although this port is not ready for production use (its missing<br>
several key features such as comdat support and full support for weak<br>
aliases) its already getting a some testing on the wasm waterfall:<br>
<a href="https://wasm-stat.us/builders/linux" rel="noreferrer" target="_blank">https://wasm-stat.us/builders/<wbr>linux</a><br>
<br>
I'm hopeful that my patch may now be at an MVP stage that could be<br>
considered for merging into upstream lld. Thoughts? LLD maintainers,<br>
would you support the addition of a new backend?<br>
<br>
cheers,<br>
sam<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>