[PATCH] D83482: [yaml2obj] - Add a syntax to override e_phoff, e_phentsize and e_phnum fields.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 00:24:13 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/yaml2obj/ELF/header-sh-fields.yaml:4-15
 ## First we check the default values.
 
-# RUN: yaml2obj --docnum=1 %s -o %t1
-# RUN: llvm-readelf --file-headers %t1 | FileCheck %s --check-prefix=DEFAULT
+# RUN: yaml2obj %s -o %t-default
+# RUN: llvm-readelf --file-headers %t-default | FileCheck %s --check-prefix=DEFAULT
 
-# DEFAULT:   Start of section headers:          88 (bytes into file)
-# DEFAULT:   Size of section headers:           64 (bytes)
-# DEFAULT:   Number of section headers:         3
-# DEFAULT:   Section header string table index: 2
-
---- !ELF
-FileHeader:
-  Class:   ELFCLASS64
-  Data:    ELFDATA2LSB
-  Type:    ET_REL
-  Machine: EM_X86_64
-
-## Override 3 fields: e_shoff, e_shnum and e_shstrndx. Check the output.
-
-# RUN: yaml2obj --docnum=2 %s -o %t2
-# RUN: llvm-readelf --file-headers %t2 | FileCheck %s --check-prefix=CUSTOM
-
-# CUSTOM: Start of section headers:          2 (bytes into file)
-# CUSTOM: Size of section headers:           64 (bytes)
-# CUSTOM: Number of section headers:         3
-# CUSTOM: Section header string table index: 4
+# DEFAULT: Start of program headers:          64 (bytes into file)
+# DEFAULT: Start of section headers:          88 (bytes into file)
----------------
jhenderson wrote:
> This case isn't really checking the default values any more. It's checking that the default variable values as specified in the YAML are followed, but the purpose of the check seems to me to be to show what happens when the fields aren't specified.
Didn't realise this is part of a stack - the comment applies to the previous commit.


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

https://reviews.llvm.org/D83482





More information about the llvm-commits mailing list