1 /* Copyright
(C
) 2000, 2001, 2003 Free Software Foundation
, Inc.
2 This file was pretty much copied from newlib.
4 This file is part of GCC.
6 GCC 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
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
into combinations with other programs
,
14 and to distribute those combinations without any restriction coming
15 from the use of
this file.
(The General
Public License restrictions
16 do apply
in other respects
; for example, they cover modification of
17 the file
, and distribution when
not linked
into a combine
20 GCC is distributed
in the hope that it will be useful
,
21 but WITHOUT ANY WARRANTY
; without even the implied warranty of
22 MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General
Public License for more details.
25 You should have received a copy of the GNU General
Public License
26 along with
this program
; see the file COPYING. If not, write to
27 the Free Software Foundation
, 59 Temple Place
- Suite
330,
28 Boston
, MA
02111-1307, USA.
*/
42 #define LOAD_ADDR
(sym
, reg
) \
43 movi
(sym
>> 48) & 65535, reg
; \
44 shori
(sym
>> 32) & 65535, reg
; \
45 shori
(sym
>> 16) & 65535, reg
; \
46 shori sym
& 65535, reg
49 .
section .text..SHmedia32
,"ax"
50 #define LOAD_ADDR
(sym
, reg
) \
51 movi
(sym
>> 16) & 65535, reg
; \
52 shori sym
& 65535, reg
56 LOAD_ADDR
(_stack
, r15
)
58 pt
/l .Lzero_bss_loop
, tr0
61 pt
/l ___setup_argv_and_call_main
, tr6
65 LOAD_ADDR
(_edata
, r0
)
72 LOAD_ADDR
(___data
, r26
)
73 LOAD_ADDR
(___rodata
, r27
)
77 pt
/l ___set_fpscr
, tr0
82 ! enable the FP unit
, by resetting SR.FD
83 ! also zero
out SR.FR
, SR.SZ
and SR.PR
, as mandated by the ABI
90 ! arrange for exit to
call fini
119 #if defined
(__SH2E__
) || defined
(__SH3E__
) || defined
(__SH4_SINGLE__
) || defined
(__SH4__
) || defined
(__SH4_SINGLE_ONLY__
)
120 mov.l set_fpscr_k
, r1
124 #endif
/* defined
(__SH2E__
) || defined
(__SH3E__
) || defined
(__SH4_SINGLE__
) || defined
(__SH4__
) || defined
(__SH4_SINGLE_ONLY__
) */
126 ! arrange for exit to
call fini
149 #if defined
(__SH2E__
) || defined
(__SH3E__
) || defined
(__SH4_SINGLE__
) || defined
(__SH4__
) || defined
(__SH4_SINGLE_ONLY__
)
152 #endif
/* defined
(__SH2E__
) || defined
(__SH3E__
) || defined
(__SH4_SINGLE__
) || defined
(__SH4__
) || defined
(__SH4_SINGLE_ONLY__
) */
161 .long ___setup_argv_and_call_main
171 ! supplied for backward compatibility only
, in case of linking
172 ! code whose main
() was compiled with an older version of GCC.