[PATCH] D42176: [WebAssembly] Optimise relocation iteration to remove n^2 loop. NFC.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 13:22:09 PST 2018


sbc100 added a comment.

In https://reviews.llvm.org/D42176#1021117, @ruiu wrote:

> > We could have gone a different route for the intermediate object and allowed multiple code sections, but then none of the existing wasm tools would load the file (i.e. they would no longer we valid wasm files) and I'm not sure this would have made the linker any simpler, since we would still not be able to match ELF in its ability to blindly concatenate everything.
>
> I don't think I agree with this point. Object files and executable files are different kind of files, so the requirement that executables must have one text and one data section doesn't have to be applied to object files. If you apply that, then you would have to come up with a way to workaround -- and that's the "chunk". I'm not particularly interested in making wasm as much similar as ELF because they are naturally different, but "chunk" is beyond that -- it just feels more complicated than necessary. I strongly believe that everything can be (and should be) sections in object files.


I understand that executables and objects are different and we are not striving to make the object files actually run-able, but we tried to make them into at least valid wasm files (with extra metadata sections).

If you feel strongly, perhaps we should have a longer discussion about that.  An issue in https://github.com/WebAssembly/tool-conventions/ is probably the best place for that.   I guess we could still revisit this.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42176





More information about the llvm-commits mailing list