[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
Sat Jul 16 07:18:21 PDT 2022
PRESIDENT810 updated this revision to Diff 445233.
PRESIDENT810 added a comment.
I removed ForceLoad enum and add LoadFrom & LoadScope. LoadFrom indicates currently where is this archive from and LoadScope means what symbols should we load from this archive (only lazy load, load ObjC symbols, load all symbols or just skip loading this time). Now addFile accepts a LoadFrom enum so it is able to know if this archive is from CLI or LC_LINKER_OPTION. Based on this LoadFrom enum and the LoadFrom enum in its cache (if any), we can decide what symbols we need to load this time. I think this could be clearer than our previous ForceLoad? Also, I added a table in Config.h's comment to explain my implementation when encountered with these flags, please check it for me to make sure that I understand this right!
I didn't make loadedArchives to store extra information, instead I make LoadFrom an attribute in ArchiveFile class, so when we access loadedArchives and obtain the cached files, we are able to know if this archive is from CLI or not. That should do the same. Tell me if you think it's better to store LoadFrom in loadedArchives and I will change it, thanks!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129556/new/
https://reviews.llvm.org/D129556
Files:
lld/MachO/Config.h
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.445233.patch
Type: text/x-patch
Size: 15000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220716/a2b0c2f5/attachment.bin>
More information about the llvm-commits
mailing list