Replace occurrences of #elif with #if...#endif.
[official-gcc.git] / gcc / config / rs6000 / sol-ci.asm
blobd0eced3a09cde7181a5cc39e9e84f52ca5d4e986
1 # crti.s for solaris
3 # Copyright (C) 1996 Free Software Foundation, Inc.
4 # Written By Michael Meissner
5 #
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by the
8 # Free Software Foundation; either version 2, or (at your option) any
9 # later version.
11 # In addition to the permissions in the GNU General Public License, the
12 # Free Software Foundation gives you unlimited permission to link the
13 # compiled version of this file with other programs, and to distribute
14 # those programs without any restriction coming from the use of this
15 # file. (The General Public License restrictions do apply in other
16 # respects; for example, they cover modification of the file, and
17 # distribution when not linked into another program.)
19 # This file is distributed in the hope that it will be useful, but
20 # WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 # General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program; see the file COPYING. If not, write to
26 # the Free Software Foundation, 59 Temple Place - Suite 330,
27 # Boston, MA 02111-1307, USA.
29 # As a special exception, if you link this library with files
30 # compiled with GCC to produce an executable, this does not cause
31 # the resulting executable to be covered by the GNU General Public License.
32 # This exception does not however invalidate any other reasons why
33 # the executable file might be covered by the GNU General Public License.
36 # This file just supplies labeled starting points for the .got* and other
37 # special sections. It is linked in first before other modules.
39 .file "scrti.s"
40 .ident "GNU C scrti.s"
42 # Start of .text
43 .section ".text"
44 .globl _ex_text0
45 _ex_text0:
47 # Exception range
48 .section ".exception_ranges","aw"
49 .globl _ex_range0
50 _ex_range0:
52 # List of C++ constructors
53 .section ".ctors","aw"
54 .globl __CTOR_LIST__
55 .type __CTOR_LIST__,@object
56 __CTOR_LIST__:
58 # List of C++ destructors
59 .section ".dtors","aw"
60 .globl __DTOR_LIST__
61 .type __DTOR_LIST__,@object
62 __DTOR_LIST__:
64 # Head of __init function used for static constructors in Solaris
65 .section ".init","ax"
66 .align 2
67 .globl __init
68 .type __init,@function
69 __init: stwu %r1,-16(%r1)
70 mflr %r0
71 stw %r31,12(%r1)
72 stw %r0,16(%r1)
74 bl _GLOBAL_OFFSET_TABLE_-4 # get the GOT address
75 mflr %r31
77 # lwz %r3,_ex_shared0@got(%r31)
78 # lwz %r4,-8(%r3) # _ex_register or 0
79 # cmpi %cr0,%r4,0
80 # beq .Lno_reg
81 # mtlr %r4
82 # blrl
83 #.Lno_reg:
85 # Head of __fini function used for static destructors in Solaris
86 .section ".fini","ax"
87 .align 2
88 .globl __fini
89 .type __fini,@function
90 __fini: stwu %r1,-16(%r1)
91 mflr %r0
92 stw %r31,12(%r1)
93 stw %r0,16(%r1)
95 bl _GLOBAL_OFFSET_TABLE_-4 # get the GOT address
96 mflr %r31
98 # _environ and its evil twin environ, pointing to the environment
99 .section ".sdata","aw"
100 .align 2
101 .globl _environ
102 .space 4
103 .weak environ
104 .set environ,_environ