Commit | Line | Data |
---|---|---|
b9734f35 JJ |
1 | .data |
2 | .align 4096 | |
3 | .section ".tdata", #alloc, #write, #tls | |
4 | .align 4 | |
5 | .globl sg1, sg2, sg3, sg4, sg5, sg6, sg7, sg8 | |
6 | .globl sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8 | |
7 | .hidden sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8 | |
8 | sg1: .word 17 | |
9 | .skip 4096 | |
10 | sg2: .word 18 | |
11 | sg3: .word 19 | |
12 | sg4: .word 20 | |
13 | sg5: .word 21 | |
14 | sg6: .word 22 | |
15 | sg7: .word 23 | |
16 | sg8: .word 24 | |
17 | sl1: .word 65 | |
18 | sl2: .word 66 | |
19 | sl3: .word 67 | |
20 | sl4: .word 68 | |
21 | sl5: .word 69 | |
22 | sl6: .word 70 | |
23 | sl7: .word 71 | |
24 | sl8: .word 72 | |
25 | sh1: .word 257 | |
26 | sh2: .word 258 | |
27 | sh3: .word 259 | |
28 | sh4: .word 260 | |
29 | sh5: .word 261 | |
30 | sh6: .word 262 | |
31 | sh7: .word 263 | |
32 | sh8: .word 264 | |
33 | .text | |
34 | .align 4096 | |
35 | .LLGETPC0: | |
36 | retl | |
37 | add %o7, %l7, %l7 | |
38 | ||
39 | .globl fn2 | |
40 | .type fn2,#function | |
41 | .proc 04 | |
42 | fn2: | |
43 | save %sp, -104, %sp | |
44 | sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7 | |
45 | call .LLGETPC0 | |
46 | add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7 | |
47 | nop;nop;nop;nop | |
48 | ||
49 | /* GD -> IE because variable is not defined in executable */ | |
50 | sethi %tgd_hi22(sG1), %l1 | |
51 | nop | |
52 | add %l1, %tgd_lo10(sG1), %l2 | |
53 | nop | |
54 | add %l7, %l2, %o0, %tgd_add(sG1) | |
55 | nop | |
56 | call __tls_get_addr, %tgd_call(sG1) | |
57 | nop | |
58 | nop;nop;nop;nop | |
59 | ||
60 | /* GD -> IE because variable is not defined in executable where | |
61 | the variable is referenced through IE too */ | |
62 | sethi %tgd_hi22(sG2), %o0 | |
63 | add %o0, %tgd_lo10(sG2), %o1 | |
64 | add %l7, %o1, %o0, %tgd_add(sG2) | |
65 | call __tls_get_addr, %tgd_call(sG2) | |
66 | nop | |
67 | nop;nop;nop;nop | |
68 | ||
69 | /* GD -> LE with global variable defined in executable */ | |
70 | sethi %tgd_hi22(sg1), %l0 | |
71 | add %l0, %tgd_lo10(sg1), %l5 | |
72 | add %l7, %l5, %o0, %tgd_add(sg1) | |
73 | call __tls_get_addr, %tgd_call(sg1) | |
74 | nop | |
75 | nop;nop;nop;nop | |
76 | ||
77 | /* GD -> LE with local variable defined in executable */ | |
78 | sethi %tgd_hi22(sl1), %o0 | |
79 | add %o0, %tgd_lo10(sl1), %o1 | |
80 | add %l7, %o1, %o0, %tgd_add(sl1) | |
81 | call __tls_get_addr, %tgd_call(sl1) | |
82 | nop | |
83 | nop;nop;nop;nop | |
84 | ||
85 | /* GD -> LE with hidden variable defined in executable */ | |
86 | sethi %tgd_hi22(sh1), %o0 | |
87 | add %o0, %tgd_lo10(sh1), %o1 | |
88 | add %l7, %o1, %o0, %tgd_add(sh1) | |
89 | call __tls_get_addr, %tgd_call(sh1) | |
90 | nop | |
91 | nop;nop;nop;nop | |
92 | ||
93 | /* LD -> LE */ | |
94 | sethi %tldm_hi22(sl1), %l1 | |
95 | nop | |
96 | add %l1, %tldm_lo10(sl1), %l2 | |
97 | nop | |
98 | add %l7, %l2, %o0, %tldm_add(sl1) | |
99 | nop | |
100 | call __tls_get_addr, %tldm_call(sl1) | |
101 | nop | |
102 | sethi %tldo_hix22(sl1), %l3 | |
103 | nop | |
104 | xor %l3, %tldo_lox10(sl1), %l4 | |
105 | nop | |
106 | add %o0, %l4, %l5, %tldo_add(sl1) | |
107 | nop | |
108 | sethi %tldo_hix22(sl2 + 2), %l2 | |
109 | nop | |
110 | xor %l2, %tldo_lox10(sl2 + 2), %l3 | |
111 | nop | |
112 | lduh [%o0 + %l3], %l6, %tldo_add(sl2 + 2) | |
113 | nop;nop;nop;nop | |
114 | ||
115 | /* LD -> LE against hidden variables */ | |
116 | sethi %tldm_hi22(sh1), %o1 | |
117 | sethi %tldo_hix22(sh1), %l3 | |
118 | add %o1, %tldm_lo10(sh1), %o2 | |
119 | sethi %tldo_hix22(sh2 + 1), %l2 | |
120 | add %l7, %o2, %o0, %tldm_add(sh1) | |
121 | xor %l3, %tldo_lox10(sh1), %l4 | |
122 | call __tls_get_addr, %tldm_call(sh1) | |
123 | xor %l2, %tldo_lox10(sh2 + 1), %l3 | |
124 | add %o0, %l4, %l5, %tldo_add(sh1) | |
125 | ldub [%o0 + %l3], %l6, %tldo_add(sh2 + 1) | |
126 | nop;nop;nop;nop | |
127 | ||
128 | /* IE against global var */ | |
129 | sethi %tie_hi22(sG2), %l1 | |
130 | nop | |
131 | add %l1, %tie_lo10(sG2), %l2 | |
132 | nop | |
133 | ld [%l7 + %l2], %l2, %tie_ld(sG2) | |
134 | nop | |
135 | add %g7, %l2, %l2, %tie_add(sG2) | |
136 | nop;nop;nop;nop | |
137 | ||
138 | /* IE -> LE against global var defined in exec */ | |
139 | sethi %tie_hi22(sg1), %o3 | |
140 | add %o3, %tie_lo10(sg1), %o3 | |
141 | ld [%l7 + %o3], %o3, %tie_ld(sg1) | |
142 | add %g7, %o3, %o4, %tie_add(sg1) | |
143 | nop;nop;nop;nop | |
144 | ||
145 | /* IE -> LE against local var */ | |
146 | sethi %tie_hi22(sl1), %l4 | |
147 | add %l4, %tie_lo10(sl1), %l1 | |
148 | ld [%l7 + %l1], %l3, %tie_ld(sl1) | |
149 | add %g7, %l3, %l3, %tie_add(sl1) | |
150 | nop;nop;nop;nop | |
151 | ||
152 | /* IE -> LE against hidden var */ | |
153 | sethi %tie_hi22(sh1), %o1 | |
154 | add %o1, %tie_lo10(sh1), %o3 | |
155 | ld [%l7 + %o3], %o0, %tie_ld(sh1) | |
156 | add %g7, %o0, %o3, %tie_add(sh1) | |
157 | nop;nop;nop;nop | |
158 | ||
159 | /* Direct access through %g7 */ | |
160 | ||
161 | /* IE against global var */ | |
162 | sethi %tie_hi22(sG5), %o3 | |
163 | add %o3, %tie_lo10(sG5), %o3 | |
164 | ld [%l7 + %o3], %o2, %tie_ld(sG5) | |
165 | ld [%g7 + %o2], %o4, %tie_add(sG5) | |
166 | nop;nop;nop;nop | |
167 | ||
168 | /* IE->LE against local var */ | |
169 | sethi %tie_hi22(sl5), %o3 | |
170 | add %o3, %tie_lo10(sl5), %o3 | |
171 | ld [%l7 + %o3], %o2, %tie_ld(sl5) | |
172 | stb %o4, [%g7 + %o2], %tie_add(sl5) | |
173 | nop;nop;nop;nop | |
174 | ||
175 | /* IE->LE against hidden var */ | |
176 | sethi %tie_hi22(sh5), %o5 | |
177 | add %o5, %tie_lo10(sh5), %o3 | |
178 | ld [%l7 + %o3], %o2, %tie_ld(sh5) | |
179 | ldsb [%g7 + %o2], %o4, %tie_add(sh5) | |
180 | nop;nop;nop;nop | |
181 | ||
182 | ret | |
183 | restore |