feat: Allow specifying library search paths in version scripts and export lists#1477
Merged
lapla-cogito merged 1 commit intoJan 22, 2026
Merged
Conversation
6625457 to
a00c975
Compare
davidlattimore
approved these changes
Jan 22, 2026
lapla-cogito
commented
Jan 22, 2026
| .export_list_path | ||
| .as_ref() | ||
| .map(|path| read_script_data(path, inputs_arena)) | ||
| .map(|path| read_script_data(&resolve_script_path(path), inputs_arena)) |
Member
Author
There was a problem hiding this comment.
At first, I thought there was no need to apply the same change to export_list, based on how mold implements the corresponding part. However, I found that GNU ld searches paths specified via -L when options such as --dynamic-list are provided. Therefore, to match GNU ld’s behavior, this change also applies to export_list.
(▰╹◡╹)❯ tree .
.
├── searchdir
│ └── test.list
└── test.c
2 directories, 2 files
(▰╹◡╹)❯ gcc -shared -o test.so test.c -fPIC -Wl,-Lsearchdir -Wl,--dynamic-list,test.list -fuse-ld=mold
mold: fatal: cannot open test.list: No such file or directory
collect2: error: ld returned 1 exit status
(▰╹^╹)❯ gcc -shared -o test.so test.c -fPIC -Wl,-Lsearchdir -Wl,--dynamic-list,test.list -fuse-ld=bfd
(▰╹◡╹)❯ ls test.so
test.so
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the
-Loption specifies a library search path, Wild now also searches that path for version scripts and export lists if none are found in the current directory.