X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=crt%2Fx86_64%2Fcrt1.s;h=40de3bed2e1903f2a804a3be200229fe1e9aa63c;hp=45cbb9dbd7d62e6cbbb5607ae82f1fa81a92d0fc;hb=2be87702b79c02b1acf68d6159a4fb399d2c9a57;hpb=1e12632591ab98a6ea3af8680716c28282552981 diff --git a/crt/x86_64/crt1.s b/crt/x86_64/crt1.s index 45cbb9db..40de3bed 100644 --- a/crt/x86_64/crt1.s +++ b/crt/x86_64/crt1.s @@ -1,4 +1,6 @@ /* Written 2011 Nicholas J. Kain, released as Public Domain */ +.weak _init +.weak _fini .text .global _start _start: @@ -7,10 +9,8 @@ _start: pop %rsi /* 2nd arg: argc */ mov %rsp,%rdx /* 3rd arg: argv */ andq $-16,%rsp /* align stack pointer */ - push %rax /* 8th arg: glibc ABI compatible */ - push %rsp /* 7th arg: glibc ABI compatible */ - xor %r8,%r8 /* 5th arg: always 0 */ - xor %rcx,%rcx /* 4th arg: always 0 */ + mov $_fini,%r8 /* 5th arg: fini/dtors function */ + mov $_init,%rcx /* 4th arg: init/ctors function */ mov $main,%rdi /* 1st arg: application entry ip */ call __libc_start_main /* musl init will run the program */ -.L0: jmp .L0 +1: jmp 1b