Ruoyu Qiu c1fca0fa14
[llvm][yaml2obj] Modify section header overriding timing (#130942)
yaml2obj should determine the program header offset (and other
properties) based on the intended values rather than the final
`sh_offset` of the section header.

`setProgramHeaderLayout` uses section offsets for determining
`p_offset`. Move section header overriding after
`setProgramHeaderLayout` to prevent `ShOffset` from affecting program
header `p_offset`.

This change adjusts the timing of when the section header is overridden
to ensure that the program headers are set correctly.

More details
[here](https://github.com/llvm/llvm-project/pull/126537#issuecomment-2700421989).

---------

Signed-off-by: Ruoyu Qiu <cabbaken@outlook.com>
Signed-off-by: Ruoyu Qiu <qiuruoyu@xiaomi.com>
Co-authored-by: Ruoyu Qiu <qiuruoyu@xiaomi.com>
2025-09-18 08:37:50 +01:00
..