[PATCH] D106412: [llvm-objcopy][MachO] Ignore all LC_SUB_* commands.

Daniel Rodríguez Troitiño via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 16:50:51 PDT 2021


drodriguez created this revision.
drodriguez added reviewers: alexander-shaposhnikov, seiya, MaskRay.
Herald added subscribers: abrachet, hiraditya.
Herald added a reviewer: rupprecht.
Herald added a reviewer: jhenderson.
drodriguez requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The LC_SUB_FRAMEWORK, LC_SUB_UMBRELLA, LC_SUB_CLIENT, and LC_SUB_LIBRARY
are used to indicate related libraries, binaries or framework names.
Their only payload is the string with the name of the object. Adding
those commands to the list of ignored/skipped load commands will avoid
an error that stop the process of copying/stripping and will copy their
contents verbatim.

Additionally, in order to have a test for this case, `yaml2obj` now
allows those four commands to contain a `PayloadString`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106412

Files:
  llvm/lib/ObjectYAML/MachOEmitter.cpp
  llvm/lib/ObjectYAML/MachOYAML.cpp
  llvm/test/tools/llvm-objcopy/MachO/sub-load-commands.test
  llvm/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106412.360321.patch
Type: text/x-patch
Size: 4575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/d4b6acc3/attachment.bin>


More information about the llvm-commits mailing list