[PATCH] D84398: [yaml2obj] - Introduce a way to set default values when using ShOffset, ShName and ShSize fields.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 06:17:38 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, atanasyan, hiraditya, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

For some fields it might be convenient to specify the `DEFAULT` as a value.
E.g. instead of:

0x18 is the standard entsize value.
-----------------------------------

EntSize: [[ENTSIZE=0x18]]

we could write just:
EntSize: [[ENTSIZE=DEFAULT]]

and just ignore the `EntSize` key, like it doesn'y exist at all.

This patch adds a support for the `DEFAULT` value for `ShOffset`,
`ShName` and `ShSize` fields. It also updates a test for llvm-readobj,
which can use the new feature now.

If the whole idea is fine, I'll post patches for another
fields we have that might benefit from this approach.


https://reviews.llvm.org/D84398

Files:
  llvm/lib/ObjectYAML/ELFYAML.cpp
  llvm/test/tools/llvm-readobj/ELF/mips-abiflags.test
  llvm/test/tools/yaml2obj/ELF/override-shname.yaml
  llvm/test/tools/yaml2obj/ELF/override-shoffset.yaml
  llvm/test/tools/yaml2obj/ELF/override-shsize.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84398.280084.patch
Type: text/x-patch
Size: 7047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200723/b347ff94/attachment.bin>


More information about the llvm-commits mailing list