[PATCH] D153215: [Object] Add ELF section type SHT_LLVM_BITCODE for LLVM bitcode

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 10:09:47 PDT 2023


MaskRay added a comment.

In D153215#4443545 <https://reviews.llvm.org/D153215#4443545>, @nikic wrote:

> Doesn't the rename defeat the purpose stated here...
>
> In D153215#4435563 <https://reviews.llvm.org/D153215#4435563>, @MaskRay wrote:
>
>> ELF's spirit is to distinguish special sections with a section type instead of a name.
>
> ...because we now need to compare the section name anyway to distinguish LTO bitcode from embedded bitcode?

We can do one of the schemes:

- make just `.llvm.lto` `SHT_LLVM_BITCODE`. Make `findBitcodeInObject` used by lld/LLVMgold.so use this section type
- make both `.llvm.lto`/`.llvmbc` `SHT_LLVM_BITCODE`. In this case `findBitcodeInObject` hard codes that the section is not `.llvmbc`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153215



More information about the llvm-commits mailing list