[llvm] [llvm][yaml2obj] Modify section header overriding timing (PR #130942)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 00:26:40 PDT 2025


================
@@ -179,3 +179,34 @@ ProgramHeaders:
 # RUN:   FileCheck %s --check-prefix=INVALID-OFFSET
 
 # INVALID-OFFSET: yaml2obj: error: 'Offset' for segment with index 1 must be less than or equal to the minimum file offset of all included sections (0x78)
+
+## Document that the "Offset" value should be checked before the section offset is overriden using "ShOffset".
+## And the offset of the first section in a segment should not greater than the offset of the segment.
----------------
jh7370 wrote:

Some comments:
* We use the term "Document" in these yaml2obj tests to indicate that we aren't convinced the behaviour is what we actually want, but it is the current behaviour. In this case, I think the behaviour (with your changes) IS what you want, so I'd use "Show" instead.
* I think the first part of this comment needs to explain what check is being performed.
* In good English grammar, you don't normally start a sentence with "And". If your test has multiple points that it covers, I'd just make it all one sentence, i.e. "Show that the "Offset" value ... and that the offset of ..." or use the term "Also", i.e. "Also, show that the offset of ..."
* You're missing a "be" between "should not" and "greater than" in the second sentence.

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


More information about the llvm-commits mailing list