[all-commits] [llvm/llvm-project] 24da8f: [lld] Fix -ObjC load behavior with LTO

Nuri Amari via All-commits all-commits at lists.llvm.org
Tue May 14 11:58:40 PDT 2024


  Branch: refs/heads/users/nuriamari/fix-lto-ObjC
  Home:   https://github.com/llvm/llvm-project
  Commit: 24da8f197f489b294ad93ae950911d7859c1498f
      https://github.com/llvm/llvm-project/commit/24da8f197f489b294ad93ae950911d7859c1498f
  Author: Nuri Amari <nuriamari at fb.com>
  Date:   2024-05-14 (Tue, 14 May 2024)

  Changed paths:
    M lld/test/MachO/objc.s
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp

  Log Message:
  -----------
  [lld] Fix -ObjC load behavior with LTO

When -ObjC is passed, the linker must force load any object files that
contain special sections that store Objective-C / Swift information that
is used at runtime.

This should work regadless if input files are bitcode or native, but
it was not working with bitcode. This is because the sections that
identify an object file that should be loaded were inconsistent when
dealing with a native file vs bitcode file. In particular, bitcode files
were not searched for `__TEXT,__swift` prefixed sections, while native
files were.

This means LLD wasn't loading certain bitcode files and forcing the
user to introduce --force-load to their linker invocation for that
archive.



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