160484Sobrien/*-
260484Sobrien * Copyright 2009 Konstantin Belousov.
360484Sobrien * All rights reserved.
460484Sobrien *
560484Sobrien * Redistribution and use in source and binary forms, with or without
660484Sobrien * modification, are permitted provided that the following conditions
7130561Sobrien * are met:
8218822Sdim * 1. Redistributions of source code must retain the above copyright
960484Sobrien *    notice, this list of conditions and the following disclaimer.
1060484Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1160484Sobrien *    notice, this list of conditions and the following disclaimer in the
1260484Sobrien *    documentation and/or other materials provided with the distribution.
1360484Sobrien *
1460484Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1560484Sobrien * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1660484Sobrien * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1760484Sobrien * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1860484Sobrien * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1960484Sobrien * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2060484Sobrien * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2160484Sobrien * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2260484Sobrien * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2360484Sobrien * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2460484Sobrien *
25218822Sdim * $FreeBSD: releng/10.2/lib/csu/i386-elf/crt1_s.S 217383 2011-01-13 23:00:22Z kib $
2660484Sobrien */
2760484Sobrien
2860484Sobrien#include <machine/asm.h>
29218822Sdim__FBSDID("$FreeBSD: releng/10.2/lib/csu/i386-elf/crt1_s.S 217383 2011-01-13 23:00:22Z kib $");
3060484Sobrien
3160484Sobrien	.text
3260484Sobrien	.align	4
3360484Sobrien	.globl	_start
3460484Sobrien	.type	_start, @function
3560484Sobrien_start:
3660484Sobrien	.cfi_startproc
3760484Sobrien	xorl	%ebp,%ebp
3860484Sobrien	pushl	%ebp
3960484Sobrien	.cfi_def_cfa_offset 4
4077298Sobrien	movl	%esp,%ebp
4177298Sobrien	.cfi_offset %ebp,-8
4260484Sobrien	.cfi_def_cfa_register %ebp
43130561Sobrien	andl	$0xfffffff0,%esp # align stack
44130561Sobrien	leal	8(%ebp),%eax
4560484Sobrien	subl	$4,%esp
4660484Sobrien	pushl	%eax		# argv
4760484Sobrien	pushl	4(%ebp)		# argc
4860484Sobrien	pushl	%edx		# rtld cleanup
4960484Sobrien	call	_start1
5060484Sobrien	int3
5160484Sobrien	.cfi_endproc
52130561Sobrien	.size	_start, . - _start
53130561Sobrien
54130561Sobrien	.section .note.GNU-stack,"",%progbits
55130561Sobrien