Skip to content

Commit b0b1817

Browse files
DanShadersADKaster
authored andcommitted
LibELF: Make orders in which we store/call things explicit
While on it, add a few spec links and remove needless conversions between DynamicLoader objects and their respective filesystem paths.
1 parent 9c707c4 commit b0b1817

File tree

5 files changed

+145
-129
lines changed

5 files changed

+145
-129
lines changed

Userland/DynamicLoader/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ ALWAYS_INLINE static void optimizer_fence()
9191
asm("" ::: "memory");
9292
}
9393

94+
[[noreturn]] void _invoke_entry(int argc, char** argv, char** envp, ELF::EntryPointFunction entry);
95+
9496
[[gnu::no_stack_protector]] void _entry(int argc, char** argv, char** envp)
9597
{
9698
char** env;
@@ -185,7 +187,8 @@ ALWAYS_INLINE static void optimizer_fence()
185187
VERIFY(main_program_fd >= 0);
186188
VERIFY(!main_program_path.is_empty());
187189

188-
ELF::DynamicLinker::linker_main(move(main_program_path), main_program_fd, is_secure, argc, argv, envp);
190+
auto entry_point = ELF::DynamicLinker::linker_main(move(main_program_path), main_program_fd, is_secure, envp);
191+
_invoke_entry(argc, argv, envp, entry_point);
189192
VERIFY_NOT_REACHED();
190193
}
191194
}

0 commit comments

Comments
 (0)