[PATCH] D43946: [WebAssembly] Reorder reloc sections to come after symtab
Nicholas Wilson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 2 01:25:22 PST 2018
ncw added a comment.
In https://reviews.llvm.org/D43946#1024049, @sbc100 wrote:
> it sounds like we shouldn't care about the ordering of name vs reloc sections. It up to the generator. yaml2obj can always put the relocs last if it likes. that doesn't mean lld needs t to do the same.
I personally think things should be consistent - and spec'ed in as constrained a way as possible/reasonable.
This came up in the discussion about Wasm's new "exception" section, where there was some discussion about how strict the ordering for it should be, relative to the existing sections. Andreas Rossberg pointed out that the "Wasmy way" so far was to specify the precise ordering of all sections (built-in sections and also the custom "name" section), and that was generally preferable to allowing sections to be laid out in different orders by different tools. So the new "exception" section is having a precise ordering given to it.
I know that our custom linking/reloc sections aren't quite the same, but they are nonetheless semi-official "spec'ed" sections, just spec'ed in a different document. The Linking.md spec would ideally say exactly what their ordering is relative to the official sections - and it's simpler for everyone just to give one official order than list several possibilities.
I've decided overnight it's a big "ugly" to put the name section in between "linking" and "reloc.", so regardless of what we agree about how/whether to //validate// the order, I think I'll make it so that LLD and yaml2wasm are consistent and put the "name" section at the very end. I don't like different tools to have unnecessary differences in their output! Plus, things should roundtrip eg LLD -> obj2yaml -> yaml2obj shouldn't reorder sections.
rLLD LLVM Linker
More information about the llvm-commits