* ld-s390/tlsbin.s: Set tls type for undefined syms.
[external/binutils.git] / ld / testsuite / ld-sparc / tlssunbin32.s
1         .section ".tbss"
2         .align  4
3         .globl bg1, bg2, bg3, bg4, bg5, bg6, bg7, bg8
4 bg1:    .word 0
5 bg2:    .word 0
6 bg3:    .word 0
7 bg4:    .word 0
8 bg5:    .word 0
9 bg6:    .word 0
10 bg7:    .word 0
11 bg8:    .word 0
12 bl1:    .word 0
13 bl2:    .word 0
14 bl3:    .word 0
15 bl4:    .word 0
16 bl5:    .word 0
17 bl6:    .word 0
18 bl7:    .word 0
19 bl8:    .word 0
20
21         .type sg2,@tls_object
22         .type sg3,@tls_object
23         .type sG6,@tls_object
24         .type sh2,@tls_object
25         .type sh3,@tls_object
26         .type sh6,@tls_object
27
28         .text
29         .globl  _start
30         .type   _start,#function
31         .proc   04
32 _start:
33         save    %sp, -104, %sp
34         .hidden _GLOBAL_OFFSET_TABLE_
35         sethi   %hi(_GLOBAL_OFFSET_TABLE_), %l4
36         or      %l4, %lo(_GLOBAL_OFFSET_TABLE_), %l4
37         nop;nop;nop;nop
38
39         /* IE against global var  */
40         sethi   %tie_hi22(sG6), %o3
41         add     %o3, %tie_lo10(sG6), %o3
42         ld      [%l4 + %o3], %o2, %tie_ld(sG6)
43         add     %g7, %o2, %o4, %tie_add(sG6)
44         nop;nop;nop;nop
45
46         /* IE -> LE against global var defined in exec  */
47         sethi   %tie_hi22(bg6), %o3
48         add     %o3, %tie_lo10(bg6), %o5
49         ld      [%l4 + %o5], %o2, %tie_ld(bg6)
50         add     %g7, %o2, %o4, %tie_add(bg6)
51         nop;nop;nop;nop
52
53         /* IE -> LE against local var  */
54         sethi   %tie_hi22(bl6), %o3
55         add     %o3, %tie_lo10(bl6), %o5
56         ld      [%l4 + %o5], %l2, %tie_ld(bl6)
57         add     %g7, %l2, %l2, %tie_add(bl6)
58         nop;nop;nop;nop
59
60         /* direct %g7 access IE -> LE against local var  */
61         sethi   %tie_hi22(bl8), %o3
62         add     %o3, %tie_lo10(bl8), %o5
63         ld      [%l4 + %o5], %l2, %tie_ld(bl8)
64         ld      [%g7 + %l2], %l2, %tie_add(bl8)
65         nop;nop;nop;nop
66
67         /* IE -> LE against hidden but not local var  */
68         sethi   %tie_hi22(sh6), %o3
69         add     %o3, %tie_lo10(sh6), %o5
70         ld      [%l4 + %o5], %l2, %tie_ld(sh6)
71         add     %g7, %l2, %l2, %tie_add(sh6)
72         nop;nop;nop;nop
73
74         /* direct %g7 access IE -> LE against hidden but not local var  */
75         sethi   %tie_hi22(bl8), %o3
76         add     %o3, %tie_lo10(bl8), %o5
77         ld      [%l4 + %o5], %l2, %tie_ld(bl8)
78         stb     %l1, [%g7 + %l2], %tie_add(bl8)
79         nop;nop;nop;nop
80
81         /* LE, global var defined in exec  */
82         sethi   %tle_hix22(sg2), %l1
83         nop
84         xor     %l1, %tle_lox10(sg2), %l2
85         nop
86         add     %g7, %l2, %l3
87         nop;nop;nop;nop
88
89         /* LE, local var  */
90         sethi   %tle_hix22(bl2+2), %o0
91         xor     %o0, %tle_lox10(bl2+2), %o0
92         add     %g7, %o0, %o0
93         nop;nop;nop;nop
94
95         /* LE, hidden var defined in exec */
96         sethi   %tle_hix22(sh2+1), %l1
97         xor     %l1, %tle_lox10(sh2+1), %o5
98         add     %g7, %o5, %o1
99         nop;nop;nop;nop
100
101         /* Direct %g7 access  */
102
103         /* LE, global var defined in exec  */
104         sethi   %tle_hix22(sg3), %l1
105         xor     %l1, %tle_lox10(sg3), %o5
106         ld      [%g7 + %o5], %o1
107         nop;nop;nop;nop
108
109         /* LE, local var  */
110         sethi   %tle_hix22(bl3 + 3), %o0
111         xor     %o0, %tle_lox10(bl3 + 3), %o0
112         stb     %o1, [%g7 + %o0]
113         nop;nop;nop;nop
114
115         /* LE, hidden var defined in exec  */
116         sethi   %tle_hix22(sh3 + 3), %o2
117         xor     %o2, %tle_lox10(sh3 + 3), %o4
118         ldstub  [%g7 + %o4], %o5
119         nop;nop;nop;nop
120
121         ret
122         restore