mirror of
git://git.musl-libc.org/musl
synced 2024-12-16 11:45:13 +00:00
2be87702b7
looks like nik copied these "extra arguments" from the i386 code. they're not actually arguments there, just 1-byte instructions to make sure the stack is aligned to 16 bytes after all the other arguments are pushed. since each push is 8 bytes on x86_64, they happened to have no effect here, but their presence is confusing and a minor waste of space.
17 lines
633 B
ArmAsm
17 lines
633 B
ArmAsm
/* Written 2011 Nicholas J. Kain, released as Public Domain */
|
|
.weak _init
|
|
.weak _fini
|
|
.text
|
|
.global _start
|
|
_start:
|
|
xor %rbp,%rbp /* rbp:undefined -> mark as zero 0 (ABI) */
|
|
mov %rdx,%r9 /* 6th arg: ptr to register with atexit() */
|
|
pop %rsi /* 2nd arg: argc */
|
|
mov %rsp,%rdx /* 3rd arg: argv */
|
|
andq $-16,%rsp /* align stack pointer */
|
|
lea _fini(%rip),%r8 /* 5th arg: fini/dtors function */
|
|
lea _init(%rip),%rcx /* 4th arg: init/ctors function */
|
|
mov main@GOTPCREL(%rip),%rdi /* 1st arg: application entry ip */
|
|
call __libc_start_main@PLT /* musl init will run the program */
|
|
1: jmp 1b
|