[llvm-dev] [LLD] Adding WebAssembly support to lld

Rafael Avila de Espindola via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 6 15:38:36 PDT 2017


Dan Gohman <sunfish at mozilla.com> writes:

>> Sorry, I meant why that didn't work with ELF (or what else didn't).
>>
>
> The standard executable WebAssembly format does not use ELF, for numerous
> reasons, most visibly that ELF is designed for sparse decoding -- headers
> contain offsets to arbitrary points in the file, while WebAssembly's format
> is designed for streaming decoding. Also, as Sam mentioned, there are a lot
> of conceptual differences. In ELF, virtual addresses are a pervasive
> organizing principle; in WebAssembly, it's possible to think about various
> index spaces as virtual address spaces, but not all address-space-oriented
> assumptions apply.

I can see why you would want your own format for distribution. My
question was really about using ELF for the .o files.

> It would also be possible for WebAssembly to use ELF ET_REL files just for
> linking, however telling LLVM and other tools to target ELF tends to lead
> them to assume that the final output is ELF and rely on ELF-specific
> features.

Things like "the dynamic linker implements copy relocations"?

Cheers,
Rafael


More information about the llvm-dev mailing list