[llvm-branch-commits] [lld] Discard SHT_LLVM_LTO sections in relocatable links (PR #92825)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 20 14:45:24 PDT 2024


https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/92825

So long as ld -r links using bitcode always result in an ELF object, and
not a merged bitcode object, the output form a relocatable link using
FatLTO objects should not have a .llvm.lto section. Prior to this, using
the object code sections would cause the bitcode section in the output
of a relocatable link to be corrupted, by concatenating all the .llvm.lto
sections together.

This patch discards SHT_LLVM_LTO sections when not using
--fat-lto-objects, so that the relocatable ELF output won't contain
inalid bitcode.





More information about the llvm-branch-commits mailing list