From 35e5024b7d246d7cf8b918f49804a8440f6b24be Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Fri, 18 Feb 2022 21:51:42 +0100 Subject: [PATCH] DynamicLinker: Replace $ORIGIN with the executable path --- Userland/Libraries/LibELF/DynamicLinker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp index fdacd398e4..66ce35adf3 100644 --- a/Userland/Libraries/LibELF/DynamicLinker.cpp +++ b/Userland/Libraries/LibELF/DynamicLinker.cpp @@ -127,7 +127,7 @@ static Result, DlErrorMessage> map_library(String c search_paths.append("/usr/local/lib"sv); for (auto const& search_path : search_paths) { - LexicalPath library_path(search_path); + LexicalPath library_path(search_path.replace("$ORIGIN"sv, LexicalPath::dirname(s_main_program_name))); int fd = open(library_path.append(name).string().characters(), O_RDONLY); if (fd < 0)