Quick Search:

View

Revision:
Expand:  
Changeset: MAIN:ragge:20120920193824

Diff

Diff from 1.2 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/pcc/pcc-libs/csu/linux/amd64/crt0.c

Annotated File View

ragge
1.2
1 /*      $Id: crt0.c,v 1.2 2012/09/20 19:38:24 ragge Exp $       */
gmcgarry
1.1
2 /*-
3  * Copyright (c) 2009 Gregory McGarry <g.mcgarry@ieee.org>
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 #include "common.h"
19
20 void __start(intchar **, char **);
21
22 asm("   .text                           \n"
23 "       .align  4                       \n"
24 "       .globl  _start                  \n"
25 "_start:                                \n"
26 "       movq %rbx,%r9                   \n"
27 "       movq %rcx,%r8                   \n"
28 "       movq %rdx,%rcx                  \n"
29 "       movq (%rsp),%rdi                \n"
30 "       leaq 16(%rsp,%rdi,8),%rdx       \n"
31 "       leaq 8(%rsp),%rsi               \n"
32 "       andq $-16,%rsp                  \n"
ragge
1.2
33 "       callq __start                   \n");
34         /* cannot return */
gmcgarry
1.1
35
36 void
37 __start(int argcchar *argv[], char *envp[])
38 {
39
40 #ifdef PROFILE
41         atexit(_mcleanup);
42         monstartup((unsigned long)&_eprol, (unsigned long)&_etext);
43 #endif
44
45         _init();
46         atexit(_fini);
47
48         exit(main(argcargvenvp));
49 }
50
51 #include "common.c"
52
ragge
1.2
53 IDENT("$Id: crt0.c,v 1.2 2012/09/20 19:38:24 ragge Exp $");
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-20 22:36 +0100