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
49 /* GD -> IE because variable is not defined in executable */
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 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)
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)
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)
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)
94 sethi %tldm_hi22(sl1), %l1
96 add %l1, %tldm_lo10(sl1), %l2
98 add %l7, %l2, %o0, %tldm_add(sl1)
100 call __tls_get_addr, %tldm_call(sl1)
102 sethi %tldo_hix22(sl1), %l3
104 xor %l3, %tldo_lox10(sl1), %l4
106 add %o0, %l4, %l5, %tldo_add(sl1)
108 sethi %tldo_hix22(sl2 + 2), %l2
110 xor %l2, %tldo_lox10(sl2 + 2), %l3
112 lduh [%o0 + %l3], %l6, %tldo_add(sl2 + 2)
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)
128 /* IE against global var */
129 sethi %tie_hi22(sG2), %l1
131 add %l1, %tie_lo10(sG2), %l2
133 ld [%l7 + %l2], %l2, %tie_ld(sG2)
135 add %g7, %l2, %l2, %tie_add(sG2)
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)
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)
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)
159 /* Direct access through %g7 */
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)
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)
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)