LibELF: Always use parent object basename for $ORIGIN processing
Using the main executable basename produces the wrong $ORIGIN processing for libraries that are secondary dependencies of the main executable, or dependencies of an object loaded via dlopen.
This commit is contained in:
parent
64d48bcdc1
commit
72066880c6
Notes:
sideshowbarker
2024-07-17 10:18:25 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/72066880c6 Pull-request: https://github.com/SerenityOS/serenity/pull/14260 Reviewed-by: https://github.com/linusg
1 changed files with 1 additions and 1 deletions
|
@ -120,7 +120,7 @@ static Optional<String> resolve_library(String const& name, DynamicObject const&
|
|||
search_paths.append("/usr/local/lib"sv);
|
||||
|
||||
for (auto const& search_path : search_paths) {
|
||||
LexicalPath library_path(search_path.replace("$ORIGIN"sv, LexicalPath::dirname(s_main_program_name)));
|
||||
LexicalPath library_path(search_path.replace("$ORIGIN"sv, LexicalPath::dirname(parent_object.filename())));
|
||||
String library_name = library_path.append(name).string();
|
||||
|
||||
if (access(library_name.characters(), F_OK) == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue