1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
; Copyright (c) 2002-2005 ARC International
.file "crti.s"
.option %reg
.global _init, _fini
.extern __mw_cpp_init, __mw_cpp_exit
.macro jmpl,target
.if $core_version > 5
jl target ; "large" model call
.else
lr %blink, [%status]
add %blink, %blink, 3
j target
.endif
.endm
.if $isa == "ARCompact"
.on assume_short
.endif
.section ".init",text
_init:
.if $isa == "ARC"
st %fp, [%sp, 0]
st %blink, [%sp, 4]
mov %fp, %sp
sub %sp, %sp, 16
.else
.cfa_bf _init
push %blink
.cfa_push {%blink}
.endif
.section ".init$999999", text, 1, 2, check_text_align=0
; this is now brought in by a reference generated by the compiler
; jmpl __mw_cpp_init
.if $isa == "ARC"
ld %blink, [%fp, 4]
j.d [%blink]
ld.a %fp, [%sp, 16]
.else
pop %blink
.cfa_pop {%blink}
j [%blink]
.cfa_ef
.endif
.section ".fini", text
_fini:
.if $isa == "ARC"
st %fp, [%sp, 0]
st %blink, [%sp, 4]
mov %fp, %sp
sub %sp, %sp, 16
.else
.cfa_bf _fini
push %blink
.cfa_push {%blink}
.endif
.section ".fini$999999", text, 1, 2, check_text_align=0
; jmpl __mw_cpp_exit
.if $isa == "ARC"
ld %blink, [%fp, 4]
j.d [%blink]
ld.a %fp, [%sp, 16]
.else
pop %blink
.cfa_pop {%blink}
j [%blink]
.cfa_ef
.endif
.end
|