[all-commits] [llvm/llvm-project] 608fb4: [lld] Discard SHT_LLVM_LTO sections in relocatable...

Paul Kirth via All-commits all-commits at lists.llvm.org
Fri Jun 7 17:56:58 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 608fb463d20e70668cf4dd3f0c58bd3de91c42eb
      https://github.com/llvm/llvm-project/commit/608fb463d20e70668cf4dd3f0c58bd3de91c42eb
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2024-06-07 (Fri, 07 Jun 2024)

  Changed paths:
    M lld/ELF/InputFiles.cpp
    M lld/test/ELF/fatlto/fatlto.test

  Log Message:
  -----------
  [lld] Discard SHT_LLVM_LTO sections in relocatable links (#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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list