[llvm] [yaml2obj][GOFF] Fix writing GOFF header (PR #91383)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 00:51:11 PDT 2024


jh7370 wrote:

> No worries, I had a couple of vacation days myself.
> 
> The main documentation entry is [Generalized object file format (GOFF)](https://www.ibm.com/docs/en/zos/3.1.0?topic=facilities-generalized-object-file-format-goff), and the description of the header record is [Module header record](https://www.ibm.com/docs/en/zos/3.1.0?topic=formats-module-header-record). There is only the architecture level in the module header, the other fields are just proposals. I'm happy to remove those - they really slipped through. The problem here is that the architecture level field is off by one, that's how I noted the problem.
> 
> Reading through the comments on Yusra's PR I believe that the implementation still does not have the required flexibility. The GOFF file format is basically a sequence of records. There are certain requirements (like header comes first, a symbol must be defined before it is use, end records comes last), but this is not enforced through the physical structure of the file. With the current approach it is not possible to omit the end record, or have the end record defined first. I changed the implementation to be more flexible, and will put up the PR soon. I would include this change, and would like to remove the undocumented fields if this is ok for you. With the new approach, it is possible to write a single record, which simplifies testing, because it reduces the "hex desert" needed to be checked.

Thanks for the suggestions, they all sound reasonable to me at this point.

https://github.com/llvm/llvm-project/pull/91383


More information about the llvm-commits mailing list