Update.
[glibc.git] / sysdeps / hppa / elf / start.S
bloba5c3e521dd0940f0cc0934fe58f6451c3a150e99
2         .text
4         .align 4
6         .import main, code
7         .import $global$, data
8         .import __libc_start_main, code
9         .import _fini, code
10         .import _init, code
12         
13         
14         
15         .globl _start
16         .export _start, ENTRY
17         .type _start,@function
18 _start:
20         .proc
21         .callinfo
23         /* load main */
24         ldil    LP%main, %r26
25         ldo     RP%main(%r26), %r26
27         /* argc and argv should be in 25 and 24 */
29         /* Expand the stack to store the 5th through 7th args */
30         ldo     64(%sp), %sp
31         
32         /* void (*rtld_fini) (void) (actually the 6th arg) */
33         stw     %r23, -56(%sp)
34         
35         /* void (*init) (void) */
36         ldil    LP%_init, %r23
37         ldo     RP%_init(%r23), %r23
39         /* void (*fini) (void) */
40         ldil    LP%_fini, %r22
41         ldo     RP%_fini(%r22), %r22
42         stw     %r22, -52(%sp)
44         /* void *stack_end */
45         stw     %sp, -60(%sp)
47         /* load global */
48         ldil    L%$global$, %dp
49         ldo     R%$global$(%dp), %dp
51         bl      __libc_start_main,%r2
52         nop
53         /* die horribly if it returned (it shouldn't) */
54         iitlbp %r0,(%r0)
55         nop
57         .procend