mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +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" {
|
extern "C" {
|
||||||
|
|
||||||
// The compiler expects a previous declaration
|
// The compiler expects a previous declaration
|
||||||
|
void _start(int, char**, char**);
|
||||||
void _entry(int, char**, char**);
|
void _entry(int, char**, char**);
|
||||||
|
|
||||||
asm(
|
NAKED void _start(int, char**, char**)
|
||||||
".globl _start\n"
|
{
|
||||||
"_start:\n"
|
asm(
|
||||||
"push $0\n"
|
"push $0\n"
|
||||||
"jmp _entry@plt\n");
|
"jmp _entry@plt\n");
|
||||||
|
}
|
||||||
|
|
||||||
void _entry(int argc, char** argv, char** envp)
|
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.
|
// Tell the compiler that this may be called from somewhere else.
|
||||||
int _entry(int argc, char** argv, char** env);
|
int _entry(int argc, char** argv, char** env);
|
||||||
|
void _start(int, char**, char**);
|
||||||
|
|
||||||
asm(
|
NAKED void _start(int, char**, char**)
|
||||||
".globl _start\n"
|
{
|
||||||
"_start:\n"
|
asm(
|
||||||
"push $0\n"
|
"push $0\n"
|
||||||
"jmp _entry@plt\n");
|
"jmp _entry@plt\n");
|
||||||
|
}
|
||||||
|
|
||||||
int _entry(int argc, char** argv, char** env)
|
int _entry(int argc, char** argv, char** env)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue