[llvm] [llvm-objdump] Add possibility to verify .note section format (PR #90458)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 00:41:30 PDT 2024


================
@@ -1,34 +1,46 @@
 ## Verify that --add-section warns on invalid note sections.
 
 # Add [namesz, descsz, type, name, desc] for a build id.
-#
+
+## Notes should be padded on 8 bits
 # RUN: echo -e -n "\x04\x00\x00\x00" >  %t-miss-padding-note.bin
 # RUN: echo -e -n "\x07\x00\x00\x00" >> %t-miss-padding-note.bin
 # RUN: echo -e -n "\x03\x00\x00\x00" >> %t-miss-padding-note.bin
 # RUN: echo -e -n "GNU\x00"          >> %t-miss-padding-note.bin
 # RUN: echo -e -n "\x0c\x0d\x0e"     >> %t-miss-padding-note.bin
-#
+
+## The namesz field bit is incorrect
 # RUN: echo -e -n "\x08\x00\x00\x00" >  %t-invalid-size-note.bin
 # RUN: echo -e -n "\x07\x00\x00\x00" >> %t-invalid-size-note.bin
 # RUN: echo -e -n "\x03\x00\x00\x00" >> %t-invalid-size-note.bin
 # RUN: echo -e -n "GNU\x00"          >> %t-invalid-size-note.bin
 # RUN: echo -e -n "\x0c\x0d\x0e\x00" >> %t-invalid-size-note.bin
 
+## Missing type field
 # RUN: echo -e -n "\x08\x00\x00\x00" >  %t-short-note.bin
 # RUN: echo -e -n "\x07\x00\x00\x00" >> %t-short-note.bin
 
 # RUN: yaml2obj %s -o %t.o
+
+## test each invalid note
----------------
jh7370 wrote:

```suggestion
## Test each invalid note.
```
Same below: comments start with a capital letter and end with a full stop, just like any full stop.

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


More information about the llvm-commits mailing list