summaryrefslogtreecommitdiff
path: root/Userland/DynamicLoader/main.cpp
diff options
context:
space:
mode:
authorWilliam Marlow <william.marlow@lux01.co.uk>2021-01-02 21:31:01 +0000
committerAndreas Kling <kling@serenityos.org>2021-01-03 19:45:16 +0100
commit747e8de96a180060474a06838fca4701b87f8a9a (patch)
treed13a568fd2f677216eb4b3cdf21c38789a07f383 /Userland/DynamicLoader/main.cpp
parent137237b9c22010bf2059e2bb89fb19918b896d69 (diff)
downloadserenity-747e8de96a180060474a06838fca4701b87f8a9a.zip
Kernel+Loader.so: Allow dynamic executables without an interpreter
Commit a3a9016701e487a5ca92d83b8cff179a190cdeb2 removed the PT_INTERP header from Loader.so which cleaned up some kernel code in execve. Unfortunately it prevents Loader.so from being run as an executable
Diffstat (limited to 'Userland/DynamicLoader/main.cpp')
-rw-r--r--Userland/DynamicLoader/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/DynamicLoader/main.cpp b/Userland/DynamicLoader/main.cpp
index e3a7352a54..0131e65960 100644
--- a/Userland/DynamicLoader/main.cpp
+++ b/Userland/DynamicLoader/main.cpp
@@ -143,8 +143,6 @@ void _start(int argc, char** argv, char** envp)
main_program_name = (const char*)auxvp->a_un.a_ptr;
}
}
- ASSERT(main_program_fd >= 0);
- ASSERT(!main_program_name.is_null());
if (main_program_name == "/usr/lib/Loader.so") {
// We've been invoked directly as an executable rather than as the
@@ -155,6 +153,9 @@ void _start(int argc, char** argv, char** envp)
_exit(1);
}
+ ASSERT(main_program_fd >= 0);
+ ASSERT(!main_program_name.is_empty());
+
ELF::DynamicLinker::linker_main(move(main_program_name), main_program_fd, argc, argv, envp);
ASSERT_NOT_REACHED();
}