This matches LLVM change D43940, and must land before or with that change.
No tests require updating :)
Differential D43946
[WebAssembly] Reorder reloc sections to come after symtab ncw on Mar 1 2018, 8:38 AM. Authored by
Details This matches LLVM change D43940, and must land before or with that change. No tests require updating :)
Diff Detail
Event TimelineComment Actions Interesting that no test changes needed. I guess its because obj2yaml doesn't display the reloc sections themselves... but injects them into the section they apply to.
Comment Actions 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. Comment Actions 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. Comment Actions Updated as requested by Sam - just reordering the two lines. Regardless of what think about how the section order will be validated - I think this change is good to go! Doesn't need anything in LLVM to land first. |
Why not just swap these two lines? I'm not sure we should care about where these sections come relative the name section.