1 /* Copyright (c) 2008, 2009, 2011 Red Hat Incorporated.
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
8 Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
11 Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
15 The name of Red Hat Incorporated may not be used to endorse
16 or promote products derived from this software without specific
17 prior written permission.
19 This software is provided by the copyright holders and contributors
20 "AS IS" and any express or implied warranties, including, but not
21 limited to, the implied warranties of merchantability and fitness for
22 a particular purpose are disclaimed. In no event shall Red Hat
23 incorporated be liable for any direct, indirect, incidental, special,
24 exemplary, or consequential damages (including, but not limited to,
25 procurement of substitute goods or services; loss of use, data, or
26 profits; or business interruption) however caused and on any theory of
27 liability, whether in contract, strict liability, or tort (including
28 negligence or otherwise) arising in any way out of the use of this
29 software, even if advised of the possibility of such damage. */
37 /* Enable the DN bit - this should have been done for us by
38 the CPU reset, but it is best to make sure for ourselves. */
43 /* Copy the .data section from ROM into RAM. */
45 mov #__romdatastart, r2
46 mov #__romdatacopysize, r3
47 #ifdef __RX_DISALLOW_STRING_INSNS__
60 /* Initialise the contents of the .bss section. */
66 /* Initialize data pointer register(s).
67 Note: The registers used here should agree with the definition of
68 GP_BASE_REGNUM in gcc/config/rx/rx.h.
69 Note: We are assuming that -mint-register has not been used when
70 compiling the application. */
72 /* Initialise the constant data pointer and small data pointers. */
76 /* Initialise the small data area pointer. */
82 #ifdef PROFILE_SUPPORT /* Defined in gcrt0.S. */
94 #ifdef PROFILE_SUPPORT
95 mov r1, r13 ; Save return code.
102 .global _rx_run_preinit_array
103 .type _rx_run_preinit_array,@function
104 _rx_run_preinit_array:
105 mov #__preinit_array_start,r1
106 mov #__preinit_array_end,r2
107 bra.a _rx_run_inilist
109 .global _rx_run_init_array
110 .type _rx_run_init_array,@function
112 mov #__init_array_start,r1
113 mov #__init_array_end,r2
115 bra.a _rx_run_inilist
117 .global _rx_run_fini_array
118 .type _rx_run_fini_array,@function
120 mov #__fini_array_start,r2
121 mov #__fini_array_end,r1
152 bsr.a _rx_run_fini_array
167 .global ___dso_handle
172 ;;; Provide Dwarf unwinding information that will help GDB stop
173 ;;; backtraces at the right place. This is stolen from assembly
174 ;;; code generated by GCC with -dA.
175 .section .debug_frame,"",@progbits
177 .4byte .LECIE0-.LSCIE0 ; Length of Common Information Entry
179 .4byte 0xffffffff ; CIE Identifier Tag
180 .byte 0x1 ; CIE Version
181 .ascii "\0" ; CIE Augmentation
182 .uleb128 0x1 ; CIE Code Alignment Factor
183 .sleb128 -1 ; CIE Data Alignment Factor
184 .byte 0xd ; CIE RA Column
185 .byte 0xc ; DW_CFA_def_cfa
188 .byte 0x8d ; DW_CFA_offset, column 0xd
193 .4byte .LEFDE0-.LASFDE0 ; FDE Length
195 .4byte .Lframe0 ; FDE CIE offset
196 .4byte .LFB2 ; FDE initial location
197 .4byte .LFE2-.LFB2 ; FDE address range
198 .byte 0xf ; DW_CFA_def_cfa_expression
199 .uleb128 1 ; length of expression
200 .byte 0x30 ; DW_OP_lit0