3 .section ".tdata", #alloc, #write, #tls
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
44 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
46 add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
50 sethi %tgd_hi22(sg1), %l1
52 add %l1, %tgd_lo10(sg1), %l2
54 add %l7, %l2, %o0, %tgd_add(sg1)
56 call __tls_get_addr, %tgd_call(sg1)
60 /* GD -> IE because variable is referenced through IE too */
61 sethi %tgd_hi22(sg2), %o0
62 add %o0, %tgd_lo10(sg2), %o1
63 add %l7, %o1, %o0, %tgd_add(sg2)
64 call __tls_get_addr, %tgd_call(sg2)
68 /* GD against local variable */
69 sethi %tgd_hi22(sl1), %o4
70 add %o4, %tgd_lo10(sl1), %o4
71 add %l7, %o4, %o0, %tgd_add(sl1)
72 call __tls_get_addr, %tgd_call(sl1)
76 /* GD -> IE against local variable referenced through IE too */
77 sethi %tgd_hi22(sl2), %o0
78 add %o0, %tgd_lo10(sl2), %o0
79 add %l7, %o0, %o0, %tgd_add(sl2)
80 call __tls_get_addr, %tgd_call(sl2)
84 /* GD against hidden and local variable */
85 sethi %tgd_hi22(sh1), %o4
86 add %o4, %tgd_lo10(sh1), %o4
87 add %l7, %o4, %o0, %tgd_add(sh1)
88 call __tls_get_addr, %tgd_call(sh1)
92 /* GD -> IE against hidden and local variable referenced through
94 sethi %tgd_hi22(sh2), %o0
95 add %o0, %tgd_lo10(sh2), %o0
96 add %l7, %o0, %o0, %tgd_add(sh2)
97 call __tls_get_addr, %tgd_call(sh2)
101 /* GD against hidden but not local variable */
102 sethi %tgd_hi22(sH1), %o4
103 add %o4, %tgd_lo10(sH1), %o4
104 add %l7, %o4, %o0, %tgd_add(sH1)
105 call __tls_get_addr, %tgd_call(sH1)
109 /* GD -> IE against hidden but not local variable referenced through
111 sethi %tgd_hi22(sH2), %o0
112 add %o0, %tgd_lo10(sH2), %o0
113 add %l7, %o0, %o0, %tgd_add(sH2)
114 call __tls_get_addr, %tgd_call(sH2)
119 sethi %tldm_hi22(sl1), %l1
121 add %l1, %tldm_lo10(sl1), %l2
123 add %l7, %l2, %o0, %tldm_add(sl1)
125 call __tls_get_addr, %tldm_call(sl1)
127 sethi %tldo_hix22(sl1), %l3
129 xor %l3, %tldo_lox10(sl1), %l4
131 add %o0, %l4, %l5, %tldo_add(sl1)
133 sethi %tldo_hix22(sl2 + 2), %l2
135 xor %l2, %tldo_lox10(sl2 + 2), %l3
137 lduh [%o0 + %l3], %l6, %tldo_add(sl2 + 2)
140 /* LD against hidden and local variables */
141 sethi %tldm_hi22(sh1), %o1
142 sethi %tldo_hix22(sh1), %l3
143 add %o1, %tldm_lo10(sh1), %o2
144 sethi %tldo_hix22(sh2 + 1), %l2
145 add %l7, %o2, %o0, %tldm_add(sh1)
146 xor %l3, %tldo_lox10(sh1), %l4
147 call __tls_get_addr, %tldm_call(sh1)
148 xor %l2, %tldo_lox10(sh2 + 1), %l3
149 add %o0, %l4, %l5, %tldo_add(sh1)
150 ldub [%o0 + %l3], %l6, %tldo_add(sh2 + 1)
153 /* LD against hidden but not local variables */
154 sethi %tldm_hi22(sH1), %o1
155 sethi %tldo_hix22(sH1 + 3), %l3
156 add %o1, %tldm_lo10(sH1), %o2
157 sethi %tldo_hix22(sH2), %l2
158 add %l7, %o2, %o0, %tldm_add(sH1)
159 xor %l3, %tldo_lox10(sH1 + 3), %l4
160 call __tls_get_addr, %tldm_call(sH1)
161 xor %l2, %tldo_lox10(sH2), %l3
162 add %o0, %l4, %l5, %tldo_add(sH1 + 3)
163 ld [%o0 + %l3], %l6, %tldo_add(sH2)
166 /* IE against global var */
167 sethi %tie_hi22(sg2), %l1
169 add %l1, %tie_lo10(sg2), %l2
171 ld [%l7 + %l2], %l2, %tie_ld(sg2)
173 add %g7, %l2, %l2, %tie_add(sg2)
176 /* IE against local var */
177 sethi %tie_hi22(sl2), %o3
178 add %o3, %tie_lo10(sl2), %o3
179 ld [%l7 + %o3], %o2, %tie_ld(sl2)
180 add %g7, %o2, %o4, %tie_add(sl2)
183 /* IE against hidden and local var */
184 sethi %tie_hi22(sh2), %l1
185 add %l1, %tie_lo10(sh2), %l2
186 ld [%l7 + %l2], %l2, %tie_ld(sh2)
187 add %g7, %l2, %l2, %tie_add(sh2)
190 /* IE against hidden but not local var */
191 sethi %tie_hi22(sH2), %l1
192 add %l1, %tie_lo10(sH2), %l2
193 ld [%l7 + %l2], %l2, %tie_ld(sH2)
194 add %g7, %l2, %l2, %tie_add(sH2)
197 /* Direct access through %g7 */
199 /* IE against global var */
200 sethi %tie_hi22(sg5), %l1
201 add %l1, %tie_lo10(sg5), %l2
202 ld [%l7 + %l2], %l2, %tie_ld(sg5)
203 ld [%g7 + %l2], %l2, %tie_add(sg5)
206 /* IE against local var */
207 sethi %tie_hi22(sl5), %o3
208 add %o3, %tie_lo10(sl5), %o4
209 ld [%l7 + %o4], %o5, %tie_ld(sl5)
210 stb %l2, [%g7 + %o5], %tie_add(sl5)
213 /* IE against hidden and local var */
214 sethi %tie_hi22(sh5), %o3
215 add %o3, %tie_lo10(sh5), %o4
216 ld [%l7 + %o4], %o5, %tie_ld(sh5)
217 lduh [%g7 + %o5], %l2, %tie_add(sh5)
220 /* IE against hidden but not local var */
221 sethi %tie_hi22(sH5), %o3
222 add %o3, %tie_lo10(sH5), %o4
223 ld [%l7 + %o4], %o5, %tie_ld(sH5)
224 st %l2, [%g7 + %o5], %tie_add(sH5)