summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibELF/DynamicLinker.cpp
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-02-18 21:51:42 +0100
committerLinus Groh <mail@linusgroh.de>2022-03-08 23:21:35 +0100
commit35e5024b7d246d7cf8b918f49804a8440f6b24be (patch)
treefb1ec1c8e2daa6e4e75082d619a0ff14d783c4bc /Userland/Libraries/LibELF/DynamicLinker.cpp
parente7f861f34cbfa160ce828b502722701a14ce0d4e (diff)
downloadserenity-35e5024b7d246d7cf8b918f49804a8440f6b24be.zip
DynamicLinker: Replace $ORIGIN with the executable path
Diffstat (limited to 'Userland/Libraries/LibELF/DynamicLinker.cpp')
-rw-r--r--Userland/Libraries/LibELF/DynamicLinker.cpp2
1 files changed, 1 insertions, 1 deletions
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<NonnullRefPtr<DynamicLoader>, 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)