[PATCH] D149440: [yaml2obj] Add support for load config section data.

Jacek Caban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 4 15:50:00 PDT 2023


jacek updated this revision to Diff 537186.
jacek added a comment.

Rebased, changed size_t casts, added more offset checks and more tests.

For the context: load config size grows over time. Microsoft occasionally extends it with new fields appended to the end. To manifest the version used, users set load config's first field, Size, to the size of variant of the structure that they use. The handling that I wrote is meant to allow specifying various versions of the struct.

With the previous version, members that did not fit specified size were silently ignored. The new version checks for that, so that it will be considered an invalid yaml, it may help catch mistakes.


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

https://reviews.llvm.org/D149440

Files:
  llvm/docs/yaml2obj.rst
  llvm/include/llvm/BinaryFormat/COFF.h
  llvm/include/llvm/ObjectYAML/COFFYAML.h
  llvm/lib/ObjectYAML/COFFEmitter.cpp
  llvm/lib/ObjectYAML/COFFYAML.cpp
  llvm/test/tools/llvm-readobj/arm64ec-chpe.yaml
  llvm/test/tools/yaml2obj/COFF/load-config-empty.yaml
  llvm/test/tools/yaml2obj/COFF/load-config-large.yaml
  llvm/test/tools/yaml2obj/COFF/load-config-small-size.yaml
  llvm/test/tools/yaml2obj/COFF/load-config-too-small.yaml
  llvm/test/tools/yaml2obj/COFF/load-config-zero-size.yaml
  llvm/test/tools/yaml2obj/COFF/load-config32.yaml
  llvm/test/tools/yaml2obj/COFF/load-config64.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149440.537186.patch
Type: text/x-patch
Size: 22959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230704/4b613e19/attachment.bin>


More information about the llvm-commits mailing list