[PATCH] D129556: [lld-macho] Fix loading same libraries from both LC_LINKER_OPTION and command line

Kaining Zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 03:27:42 PDT 2022


PRESIDENT810 created this revision.
PRESIDENT810 added reviewers: int3, oontvoo, thakis, gkm.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
PRESIDENT810 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This fixes https://github.com/llvm/llvm-project/issues/56059 and https://github.com/llvm/llvm-project/issues/56440. This is inspired by tapthaker's patch (https://reviews.llvm.org/D127941), and has reused his test cases. This patch adds an eunm "LoadScope" to indicate the scope of symbols we plan to load from an archive. If lld tries to load the same library loaded previously by LC_LINKER_OPTION from the command line, it will use this LoadScope to determine if it should be affected by -all_load & -ObjC flags. This also allow prevents -force_load from affecting archives loaded previously without such flag, whereas tapthaker's patch will fail such test case (introduced by https://reviews.llvm.org/D128025).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129556

Files:
  lld/MachO/Driver.cpp
  lld/MachO/InputFiles.h
  lld/test/MachO/lc-linker-option.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129556.443897.patch
Type: text/x-patch
Size: 5910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220712/cb95fc36/attachment.bin>


More information about the llvm-commits mailing list