yaml2obj currently derives the p_filesz, p_memsz, and p_offset values from sections. This makes writing tests for certain formats more complex, and sometimes impossible. This patch allows setting these fields explicitly, overriding the default value, when relevant.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I think there are some really funky tests in llvm-objcopy that we can fix now but it's going to take a careful eye to see which ones.
Thanks! Just to note that this does NOT force the sections that are in the segments to appear at different offsets than they otherwise would. That will require some different changes at some point, which I would certainly appreciate, but don't need at the moment, because you can use the section's address align value to achieve the same effect usually.
I have a minor question. I do not think it is really important so should not be stoppable for landing this.
test/tools/yaml2obj/program-header-size-offset.yaml | ||
---|---|---|
53 ↗ | (On Diff #190663) | So out of curiosity: was it important for some reason to have an arbitrary numeric type here? |
test/tools/yaml2obj/program-header-size-offset.yaml | ||
---|---|---|
53 ↗ | (On Diff #190663) | This was requested in an internal review of this before I put up a similar patch up for review previously. The idea is that the standard PT_* types have special semantics, and therefore by using a non-standard type, it bypasses any issues to do with it (and hopefully doesn't suggest that the type is important, together with the comment). |
test/tools/yaml2obj/program-header-size-offset.yaml | ||
---|---|---|
53 ↗ | (On Diff #190663) | I see, thanks. (to clarify: the first thing I tried when saw this is to lookup in LLVM for 6abcdef0 and 0xabcdef0, |