david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/arch/i386/prefix/linuxprefix.S
Michael Brown 030e5a064e [build] Use unique entry symbols for each prefix
Some binutils versions will drag in an object to satisfy the entry
symbol; some won't.  Try to cope with this exciting variety of
behaviour by ensuring that all entry symbols are unique.

Remove the explicit inclusion of the prefix object on the linker
command line, since the entry symbol now provides all the information
needed to identify the prefix.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-02-23 21:12:56 +00:00

29 lines
477 B
ArmAsm

#include <linux/unistd.h>
.section ".text"
.code32
.globl _linux_start
.type _linux_start, @function
_linux_start:
xorl %ebp, %ebp
popl %esi // save argc
movl %esp, %edi // save argv
andl $~15, %esp // 16-byte align the stack
pushl %edi // argv -> C arg2
pushl %esi // argc -> C arg1
call save_args
/* Our main doesn't use any arguments */
call main
movl %eax, %ebx // rc -> syscall arg1
movl $__NR_exit, %eax
int $0x80
.size _start, . - _start