[llvm] Add support to YAML for program headers with content. (PR #192364)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 02:37:09 PDT 2026
https://github.com/jh7370 commented:
Are you aware of the concept of "Fill" sections in yaml2obj? These were implemented to provide this kind of functionality, i.e. data in the ELF that is not covered by Section or other entries, including segments (or even parts of segments). They work as entries in the Section list, with a type field of "Fill" instead of "SHT_whatever", but no section header table entry is generated for them. They can still be specified by FirstSec/LastSec, allowing you to either have a single Fill with the whole content of the segment specified (thus creating a segment with content but no sections) or interspersed with regular sections (allowing you to specify data in between sections within a segment).
I don't think Fills have been hooked up to obj2yaml, so you'd need to implement that somehow (and for completeness, I'd like that to work independently of program headers, so that they can be used to cover data in the ELF that is not covered by segments or sections).
That all being said, I can see the appeal for a Content field in a program header entry. I'm just a little concerned about having two methods to do the same thing, risking conflict.
https://github.com/llvm/llvm-project/pull/192364
More information about the llvm-commits
mailing list