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

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


  Branch: refs/heads/users/nuriamari/fix-lto-ObjC
  Home:   https://github.com/llvm/llvm-project
  Commit: fa4ea07529982ebcd19fa1b5bec5720337e76269
      https://github.com/llvm/llvm-project/commit/fa4ea07529982ebcd19fa1b5bec5720337e76269
  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