[all-commits] [llvm/llvm-project] 141391: [lld] Fix -ObjC load behavior with LTO (#92162)

Nuri Amari via All-commits all-commits at lists.llvm.org
Wed May 15 09:21:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 141391ad2f22885342935442642c6c892f43e1ed
      https://github.com/llvm/llvm-project/commit/141391ad2f22885342935442642c6c892f43e1ed
  Author: Nuri Amari <nuri.amari99 at gmail.com>
  Date:   2024-05-15 (Wed, 15 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 (#92162)

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.

Co-authored-by: Nuri Amari <nuriamari at fb.com>



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