[PATCH] D63771: [yaml2obj] - Allow overriding e_shentsize, e_shoff, e_shnum and e_shstrndx fields in the YAML.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 02:46:52 PDT 2019


jhenderson added inline comments.


================
Comment at: test/tools/yaml2obj/elf-header-sh-fields.yaml:4
+
+## At first we check the default values.
+
----------------
Get rid of "At"


================
Comment at: test/tools/yaml2obj/elf-header-sh-fields.yaml:9
+
+--- !ELF
+FileHeader:
----------------
For consistency with the other test cases, move this YAML after the DEFAULT checks.


================
Comment at: test/tools/yaml2obj/elf-header-sh-fields.yaml:43-44
+## Finally, we use the same YAML as above, but set e_shentsize to 1.
+## Check the result using raw output from 'od' because llvm-readelf
+## is unable to dump such headers.
+
----------------
FWIW, I think this is a bug in llvm-readelf. I reckon it should be able to dump the file header regardless of the values, unless it actually has to reference something else (e.g. for many sections).


================
Comment at: test/tools/yaml2obj/elf-header-sh-fields.yaml:47
+# RUN: yaml2obj --docnum=3 %s -o %t3
+# RUN: od -t x1 -v -j0x3a -N1 %t3 | FileCheck %s --check-prefix=NEWSIZE
+# RUN: od -t x1 -v -j0x3a -N1 %t2 | FileCheck %s --check-prefix=OLDSIZE
----------------
Nit: it would be easier for me to read if `-j0x3a` has a space in it, i.e. `-j 0x3a`.


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

https://reviews.llvm.org/D63771





More information about the llvm-commits mailing list