[PATCH] D63927: [Object/invalid.test] - Convert Object/corrupt.test to YAML and merge the result into invalid.test

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 03:35:19 PDT 2019


jhenderson added inline comments.


================
Comment at: test/Object/invalid.test:314
+# RUN: yaml2obj %s --docnum=14 -o %t14
+# RUN: not llvm-readobj -sections %t14 2>&1 | FileCheck --check-prefix=BROKEN-SECNAME %s
+
----------------
Nit: -sections -> --sections (for consistency with the rest of the file).

Same below with other switches.


================
Comment at: test/Object/invalid.test:344-346
+  - Name: .foo
+    Type: SHT_PROGBITS
+    ShOffset: 0xFFFF0000
----------------
Could you line these values up?


================
Comment at: test/Object/invalid.test:393
+
+# RUN: not llvm-readobj -l %p/Inputs/corrupt-invalid-phentsize.elf.x86-64 2>&1 | \
+# RUN:   FileCheck --check-prefix=PHENTSIZE %s
----------------
Nit: I find it easier to read the test if the '|' is on the next line, i.e:

`# RUN:   | FileCheck --check-prefix=PHENTSIZE %s`

Same applies below.


================
Comment at: test/Object/invalid.test:427
+
+## Check that llvm-readobj report an error when a dynamic relocation section
+## has sh_entsize field which size != sizeof(Elf_Rela).
----------------
report -> reports


================
Comment at: test/Object/invalid.test:428
+## Check that llvm-readobj report an error when a dynamic relocation section
+## has sh_entsize field which size != sizeof(Elf_Rela).
+
----------------
which -> with


================
Comment at: test/Object/invalid.test:436
+
+## Check that llvm-readobj report an error when .dynamic section has invalid size. 
+
----------------
report -> reports

How is the size "invalid"? The comment needs to be adjusted to say that the size is not a multiple of a dynamic tag's size, or something to that effect.


================
Comment at: test/Object/invalid.test:455
+## PT_DYNAMIC's p_offset field is so large that p_offset + p_filesz is larger
+## than object size. Check llvm-readobj reports it.
+
----------------
than object -> than the object

I think you can use the ProgramHeader Offset field here to make this with YAML. Aternatively, you could try using python's trucate() function to shorten the file?


================
Comment at: test/Object/invalid.test:464
+## PT_DYNAMIC's p_filesz field is so large that p_offset + p_filesz is larger
+## than object size. Check llvm-readobj reports it.
+
----------------
than the object

This case can be written in YAML using a custom FileSize field in the program header.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63927/new/

https://reviews.llvm.org/D63927





More information about the llvm-commits mailing list