[PATCH] D80099: [llvm-objcopy][MachO] Add support for removing Swift symbols

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 17 21:48:45 PDT 2020


alexshap created this revision.
alexshap added reviewers: smeenai, jhenderson.
Herald added subscribers: abrachet, MaskRay, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: rupprecht.
Herald added a project: LLVM.

cctools' strip has the option "-T" which forces the removal of the symbols whose names begin with `_$S' or `_$s' only if it finds an __objc_image_info section containing a non-zero swift version (and the binary is either an executable or a dynamic library).
This diff implements this option in llvm-strip for MachO.

Test plan: make check-all


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80099

Files:
  llvm/test/tools/llvm-objcopy/MachO/remove-swift-symbols.test
  llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
  llvm/tools/llvm-objcopy/CopyConfig.cpp
  llvm/tools/llvm-objcopy/CopyConfig.h
  llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
  llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
  llvm/tools/llvm-objcopy/MachO/MachOReader.cpp
  llvm/tools/llvm-objcopy/MachO/MachOReader.h
  llvm/tools/llvm-objcopy/MachO/Object.h
  llvm/tools/llvm-objcopy/StripOpts.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80099.264528.patch
Type: text/x-patch
Size: 10963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200518/7b7e217d/attachment.bin>


More information about the llvm-commits mailing list