Resolves issue https://github.com/llvm/llvm-project/issues/56059
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you make the commit message more detailed? It's 1) nice not to make people go to GH issues to understand the changes 2) the description in the issue isn't super clear as-is (I understood the diff better after looking at the test case)
While refreshing my memory of how -force_load worked, I realized we lacked a test case covering what happens if a library is loaded as a regular (Default) load and then subsequently force-loaded. It looks like in that case ld64 doesn't force-load it (so our current implementation is behaving correctly in that regard). I'll put up a diff with those tests in a bit.
lld/MachO/Driver.cpp | ||
---|---|---|
250–251 | how about having a single map of StringRef -> {ForceLoad, ArchiveFile *}, and then perform a load / update the map only if the existing entry has ForceLoad::No but the new load is ForceLoad::Yes or Default? | |
lld/test/MachO/lc-linker-option.ll | ||
81 | explicitly | |
95 | explicitly | |
106 | can we add a test case for the -force_load + LC_LINKER_OPTION combination? |
how about having a single map of StringRef -> {ForceLoad, ArchiveFile *}, and then perform a load / update the map only if the existing entry has ForceLoad::No but the new load is ForceLoad::Yes or Default?