(ELF_MACHINE_NO_RELA): Define unconditionally to defined RTLD_BOOTSTRAP.
[glibc-ports.git] / sysdeps / unix / sysv / aix / start.s
blob79d8ef48917693c60571f8b0686e5afe9e652a45
1 /* Copyright (C) 2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 In addition to the permissions in the GNU Lesser General Public
10 License, the Free Software Foundation gives you unlimited
11 permission to link the compiled version of this file with other
12 programs, and to distribute those programs without any restriction
13 coming from the use of this file. (The GNU Lesser General Public
14 License restrictions do apply in other respects; for example, they
15 cover modification of the file, and distribution when not linked
16 into another program.)
18 Note that people who make modified versions of this file are not
19 obligated to grant this special exception for their modified
20 versions; it is their choice whether to do so. The GNU Lesser
21 General Public License gives permission to release a modified
22 version without this exception; this exception also makes it
23 possible to release a modified version which carries forward this
24 exception.
26 The GNU C Library is distributed in the hope that it will be useful,
27 but WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 Lesser General Public License for more details.
31 You should have received a copy of the GNU Lesser General Public
32 License along with the GNU C Library; if not, write to the Free
33 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
34 02111-1307 USA. */
36 .file "start.s"
37 .toc
38 T.lsd: .tc __libc_start_data[tc], __libc_start_data[rw]
39 T.main: .tc main[tc], main[rw]
40 T.init: .tc __libc_start_init[tc], __libc_start_init[rw]
41 T.fini: .tc __libc_start_fini[tc], __libc_start_init[rw]
42 T.rtld_fini : .tc __libc_start_rtld_fini[tc], __libc_start_rtld_fini[rw]
44 .globl __start
45 .globl .__start
46 .globl __libc_start_data
48 .extern .__libc_start_main
49 .extern .main
50 .extern main
51 .extern __libc_start_init
52 .extern __libc_start_fini
53 .extern __libc_start_rtld_fini
55 /* Text */
57 .csect __start[ds]
58 __start:
59 .long .__start, TOC[tc0], 0
61 .csect .text[pr]
62 .__start:
64 /* No prologue needed, __start does not have to follow the ABI.
66 Input from kernel/loader
67 r1 : stack
68 r2 : TOC
69 r3 : argc
70 r4 : argv
71 r5 : envp
72 r28 : data origin
73 r29 : text origin
74 r30 : module count
75 r31 : default processing flag
77 If r31 == r30, no special processing is needed, ie r28, r29 & r30
78 are not used
80 Save input in __libc_start_data */
81 l 16, T.lsd(2)
82 st 1, 0(16) /* stack */
83 st 2, 4(16) /* toc */
84 st 3, 8(16) /* argc */
85 st 4, 12(16) /* argv */
86 st 5, 16(16) /* envp */
87 st 28, 20(16) /* data origin */
88 st 29, 24(16) /* text origin */
89 st 30, 28(16) /* module count */
90 st 31, 32(16) /* special */
92 /* Call __libc_start_main() */
94 bl .__libc_start_main
95 nop
97 /* No epilog needed, __start does not have to follow the ABI */
99 /* Trace back */
100 TB.__start:
101 .long 0x0
102 .long 0xc2040
103 .long 0x0
104 .long TB.__start - .__start
105 .short 7
106 .byte "__start"
107 .byte 0,0,0
109 /* Data
110 __libc_start_data
111 Space to keep libc initialization information */
113 .csect __libc_start_data[rw]
114 __libc_start_data:
115 /* For kernel/loader input args */
116 .space 36
118 /* Externs */
119 .long main
120 init:
121 .long __libc_start_init
122 fini:
123 .long __libc_start_fini
124 rtld_fini:
125 .long __libc_start_rtld_fini
126 .space 0x1000 + (4 + rtld_fini - __libc_start_data)