mailing list of musl libc
 help / color / mirror / code / Atom feed
1c06a656571bd9aa8c957ced942708cb9d2d3b76 blob 824 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 
/* 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.
			   we pop 2 words from the stack,
			   so rsi contains argv in the high bits and argc in the low bits*/
	movl %esi, %esi /* clear the upper bits of the argc argument */
	mov %rsp,%rdx   /* copy address to first argv member into rdx, the reg for the 3rd arg */
	subq $4, %rdx
	andq $-16,%rsp  /* align stack pointer */
	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 */
1:	jmp 1b
debug log:

solving 1c06a65 ...
found 1c06a65 in https://inbox.vuxu.org/musl/52BE165C.4040700@barfooze.de/

applying [1/1] https://inbox.vuxu.org/musl/52BE165C.4040700@barfooze.de/
diff --git a/crt/x32/crt1.s b/crt/x32/crt1.s
new file mode 100644
index 0000000..1c06a65

Checking patch crt/x32/crt1.s...
Applied patch crt/x32/crt1.s cleanly.

index at:
100644 1c06a656571bd9aa8c957ced942708cb9d2d3b76	crt/x32/crt1.s

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).