[PATCH] D113234: Extend obj2yaml to optionally preserve raw __LINKEDIT/__DATA segments.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 18:38:20 PDT 2021


aprantl created this revision.
aprantl added reviewers: davide, JDevlieghere, steven_wu.
Herald added a subscriber: hiraditya.
aprantl requested review of this revision.
Herald added a project: LLVM.

I am planning to upstream MachOObjectFile code to support Darwin
chained fixups. In order to test the new parser features we need a way
to produce correct (and incorrect) chained fixups. Right now the only
tool that can produce them is the Darwin linker. To avoid having to
check in binary files, this patch allows obj2yaml to print a hexdump
of the raw __LINKEDIT and __DATA segment, which both allows to
bootstrap the parser and enables us to easily create malformed inputs
to test error handling in the parser.

      

This patch adds two new options to obj2yaml:

  -raw-data-segment
  -raw-linkedit-segment


https://reviews.llvm.org/D113234

Files:
  llvm/include/llvm/Object/MachO.h
  llvm/include/llvm/ObjectYAML/MachOYAML.h
  llvm/lib/Object/MachOObjectFile.cpp
  llvm/lib/ObjectYAML/MachOEmitter.cpp
  llvm/lib/ObjectYAML/MachOYAML.cpp
  llvm/test/tools/obj2yaml/MachO/raw-linkedit.yaml
  llvm/tools/obj2yaml/macho2yaml.cpp
  llvm/tools/obj2yaml/obj2yaml.cpp
  llvm/tools/obj2yaml/obj2yaml.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113234.384936.patch
Type: text/x-patch
Size: 17532 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211105/bfcf112b/attachment.bin>


More information about the llvm-commits mailing list