[PATCH] D132267: [llvm-objcopy][MachO] Remove more sections with llvm-bitcode-strip

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 09:24:15 PDT 2022


keith added a comment.

In D132267#3738697 <https://reviews.llvm.org/D132267#3738697>, @rmaz wrote:

> I see the producers of the sections here:
>
> - https://github.com/llvm/llvm-project/blob/main/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp#L4910-L4938
> - https://github.com/apple/swift/blob/91b2abe99686600cd18daa2e898d8376440fba9e/lib/IRGen/IRGen.cpp#L1131-L1140
> - https://github.com/llvm/llvm-project/blob/main/clang/tools/driver/cc1as_main.cpp#L517-L524
>
> The only one not totally clear is the `__asm` section, is this the only time that section is used?

According to https://jonasdevlieghere.com/embedded-bitcode/ and https://lists.llvm.org/pipermail/llvm-dev/2016-June/101019.html `__LLVM,__asm` is just a way to know that the source was built directly from assembly. I included it given this logic from ld64 https://github.com/keith/ld64/blob/eddf3fd275669887e70392a1f7d8355222fa295e/src/ld/parsers/macho_relocatable_file.cpp#L2631-L2643 and it looks like ld64 uses this knowledge for some logic https://github.com/keith/ld64/blob/eddf3fd275669887e70392a1f7d8355222fa295e/src/ld/passes/bitcode_bundle.cpp#L662-L664

Either way I think it's safe to remove as Apple's bitcode_strip does as well


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132267



More information about the llvm-commits mailing list