[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
Fri Mar 2 11:24:44 PST 2018


sbc100 added a comment.

In https://reviews.llvm.org/D42176#1025688, @ncw wrote:

> Thanks for looking into improving the comments! :)
>
> In https://reviews.llvm.org/D42176#1024151, @ruiu wrote:
>
> > As to the spec, how much is it fixed at the moment? You said that it's too late, but IIRC, Sam is trying to emit relocation per chunk, instead of emitting a single relocation per file. That's not a file format change?
>
>
> The Wasm core sections are very fixed, they're used by browsers (Firefox, Chrome, Edge, Safari...) and that boat has sailed. So that includes the way functions and globals are encoded. The bits specific to object files (like relocations) are under our control, and we can still change those. And of course, object files don't have to use a FUNCTION section for functions - but not doing so would be counterintuitive. The FUNCTION section we have no control over, that's set in stone.


While you are correct that we can't change the executable format, the object file format, as you say, is under our control, so I think think should rely on the "we can't change it" argument too strongly.

We could, for example, have an object format the contains one code section per function and one data section per segment.   I'm not suggesting we do that.. but its conceivable.    It would even be pretty easy to have existing tools such as wabt support this (by parsing multiple code and data sections as if they were one).


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42176





More information about the llvm-commits mailing list