clang -ffat-lto-objects can use this new ELF section type for the .llvm.lto
section for fat LTO support (D146776).
Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977
Differential D153215
[Object] Add ELF section type SHT_LLVM_BITCODE for LLVM bitcode MaskRay on Jun 17 2023, 6:57 PM. Authored by
Details clang -ffat-lto-objects can use this new ELF section type for the .llvm.lto Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977
Diff Detail
Event TimelineComment Actions Why is a new section type necessary? Will this cause any compatibility issues with old binutils versions? Comment Actions Is it worth an llvm-objdump test too? Functionally looks fine, but I have no opinion on the overall feature itself (and therefore whether a new section type etc is needed for it). I will say that if the feature has been accepted, a new section type would seem appropriate, so that tooling can handle it appropriately without having to check section names.
Comment Actions ELF's spirit is to distinguish special sections with a section type instead of a name. (Older object file formats (COFF,Mach-O) don't use this convention, it's fine.) Comment Actions I think normal code paths of llvm-objdump do not print section types. (llvm-objdump -h doesn't). Comment Actions Good point, thanks.
Comment Actions Doesn't the rename defeat the purpose stated here... ...because we now need to compare the section name anyway to distinguish LTO bitcode from embedded bitcode? Comment Actions We can do one of the schemes:
Comment Actions Dropping support for -embed-bitcode was brought up in the original RFC for FatLTO. The plan I recall was to deprecate the option, make it CC1 , and see if MLGO (the only remaining user we're aware of) could use a different solution and if they could, then drop it altogether. The important bits start roughly here https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977/15, but there are some other points raised earlier in the thread too. In light of that plan, I'm not too sure how important it is to provide support for .llvmbc. @mtrofin, since I think you would be impacted by significant changes in this area, do you have thoughts here? Comment Actions I'll land this soon, as I do wish that .llvm.lto has a proper section type. This aligns with other SHT_LLVM_* we have. |
This line probably wants adjusting.