summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-07-11 15:57:56 +0200
committerGunnar Beutner <gunnar@beutner.name>2021-07-11 17:07:20 +0200
commita8d86cc533fcbc78b8d3fb8bb05fe00768381808 (patch)
treecb7809909b0ea5d77931e6b592f46f2de13c555b
parent112c7f9a5b82519117cf8c0d1958ef8fe5303865 (diff)
downloadserenity-a8d86cc533fcbc78b8d3fb8bb05fe00768381808.zip
DynamicLoader+LibC: Make _start a naked function
-rw-r--r--Userland/DynamicLoader/main.cpp12
-rw-r--r--Userland/Libraries/LibC/crt0.cpp12
2 files changed, 14 insertions, 10 deletions
diff --git a/Userland/DynamicLoader/main.cpp b/Userland/DynamicLoader/main.cpp
index 6156151aa6..efee7a8f30 100644
--- a/Userland/DynamicLoader/main.cpp
+++ b/Userland/DynamicLoader/main.cpp
@@ -94,13 +94,15 @@ this helper program directly.
extern "C" {
// The compiler expects a previous declaration
+void _start(int, char**, char**);
void _entry(int, char**, char**);
-asm(
- ".globl _start\n"
- "_start:\n"
- "push $0\n"
- "jmp _entry@plt\n");
+NAKED void _start(int, char**, char**)
+{
+ asm(
+ "push $0\n"
+ "jmp _entry@plt\n");
+}
void _entry(int argc, char** argv, char** envp)
{
diff --git a/Userland/Libraries/LibC/crt0.cpp b/Userland/Libraries/LibC/crt0.cpp
index 02ab162785..f496dba46e 100644
--- a/Userland/Libraries/LibC/crt0.cpp
+++ b/Userland/Libraries/LibC/crt0.cpp
@@ -20,12 +20,14 @@ int main(int, char**, char**);
// Tell the compiler that this may be called from somewhere else.
int _entry(int argc, char** argv, char** env);
+void _start(int, char**, char**);
-asm(
- ".globl _start\n"
- "_start:\n"
- "push $0\n"
- "jmp _entry@plt\n");
+NAKED void _start(int, char**, char**)
+{
+ asm(
+ "push $0\n"
+ "jmp _entry@plt\n");
+}
int _entry(int argc, char** argv, char** env)
{