mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
DynamicLoader+LibC: Make _start a naked function
This commit is contained in:
parent
112c7f9a5b
commit
a8d86cc533
2 changed files with 14 additions and 10 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue