[dlfcn] Add library search path for DT_NEEDED resolution (#2076, #2122)#4
Draft
esaurez wants to merge 1 commit into
Draft
[dlfcn] Add library search path for DT_NEEDED resolution (#2076, #2122)#4esaurez wants to merge 1 commit into
esaurez wants to merge 1 commit into
Conversation
577e8cf to
099b25a
Compare
099b25a to
af08a9f
Compare
1677feb to
0b657d1
Compare
5356da0 to
19608f9
Compare
…2076, nanvix#2122) Add resolve_library_path() that searches configured directories (default: lib/) for bare library names from DT_NEEDED entries. Paths are normalized by stripping leading / to ensure /lib/libc.so and lib/libc.so are treated as the same library. Changes: - Add LIBRARY_SEARCH_PATHS static with default ["lib/"]. - Add resolve_library_path() with leading-/ stripping and file probing. - dlopen() calls resolve_library_path() at entry. - load_all_dependencies() resolves bare dep names and matches against both bare and resolved names. Closes nanvix#2076 Closes nanvix#2122 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
19608f9 to
0d0d6fa
Compare
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.
Summary
Add library search path resolution for bare
DT_NEEDEDnames and path normalization to prevent duplicate loading.Fixes nanvix#2076 and nanvix#2122. Depends on PR #3 (atomic registry rollback).
Changes
resolve_library_path(): Searcheslib/for bare library names (e.g.,libm.so->lib/libm.so). Strips leading/so/lib/libc.soandlib/libc.soproduce the same canonical path.dlopen(): Callsresolve_library_path()at entry to normalize the filename.load_all_dependencies(): Resolves bare dep names and matches against both bare and resolved names in the registry.Affected Files
src/libs/syscall/src/dlfcn/syscall/mod.rs—LIBRARY_SEARCH_PATHS,resolve_library_path()src/libs/syscall/src/dlfcn/syscall/dlopen.rs— path resolution at entry and in dep loadingTesting
All existing integration tests pass.