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
43 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
45 add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
48 /* GD -> IE because variable is not defined in executable */
49 sethi %tgd_hi22(sG1), %l1
51 add %l1, %tgd_lo10(sG1), %l2
53 add %l7, %l2, %o0, %tgd_add(sG1)
55 call __tls_get_addr, %tgd_call(sG1)
59 /* GD -> IE because variable is not defined in executable where
60 the 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 -> LE with global variable defined in executable */
69 sethi %tgd_hi22(sg1), %l0
70 add %l0, %tgd_lo10(sg1), %l5
71 add %l7, %l5, %o0, %tgd_add(sg1)
72 call __tls_get_addr, %tgd_call(sg1)
76 /* GD -> LE with local variable defined in executable */
77 sethi %tgd_hi22(sl1), %o0
78 add %o0, %tgd_lo10(sl1), %o1
79 add %l7, %o1, %o0, %tgd_add(sl1)
80 call __tls_get_addr, %tgd_call(sl1)
84 /* GD -> LE with hidden variable defined in executable */
85 sethi %tgd_hi22(sh1), %o0
86 add %o0, %tgd_lo10(sh1), %o1
87 add %l7, %o1, %o0, %tgd_add(sh1)
88 call __tls_get_addr, %tgd_call(sh1)
93 sethi %tldm_hi22(sl1), %l1
95 add %l1, %tldm_lo10(sl1), %l2
97 add %l7, %l2, %o0, %tldm_add(sl1)
99 call __tls_get_addr, %tldm_call(sl1)
101 sethi %tldo_hix22(sl1), %l3
103 xor %l3, %tldo_lox10(sl1), %l4
105 add %o0, %l4, %l5, %tldo_add(sl1)
107 sethi %tldo_hix22(sl2 + 2), %l2
109 xor %l2, %tldo_lox10(sl2 + 2), %l3
111 lduh [%o0 + %l3], %l6, %tldo_add(sl2 + 2)
114 /* LD -> LE against hidden variables */
115 sethi %tldm_hi22(sh1), %o1
116 sethi %tldo_hix22(sh1), %l3
117 add %o1, %tldm_lo10(sh1), %o2
118 sethi %tldo_hix22(sh2 + 1), %l2
119 add %l7, %o2, %o0, %tldm_add(sh1)
120 xor %l3, %tldo_lox10(sh1), %l4
121 call __tls_get_addr, %tldm_call(sh1)
122 xor %l2, %tldo_lox10(sh2 + 1), %l3
123 add %o0, %l4, %l5, %tldo_add(sh1)
124 ldub [%o0 + %l3], %l6, %tldo_add(sh2 + 1)
127 /* IE against global var */
128 sethi %tie_hi22(sG2), %l1
130 add %l1, %tie_lo10(sG2), %l2
132 ldx [%l7 + %l2], %l2, %tie_ldx(sG2)
134 add %g7, %l2, %l2, %tie_add(sG2)
137 /* IE -> LE against global var defined in exec */
138 sethi %tie_hi22(sg1), %o3
139 add %o3, %tie_lo10(sg1), %o3
140 ldx [%l7 + %o3], %o2, %tie_ldx(sg1)
141 add %g7, %o2, %o4, %tie_add(sg1)
144 /* IE -> LE against local var */
145 sethi %tie_hi22(sl1), %l4
146 add %l4, %tie_lo10(sl1), %l1
147 ldx [%l7 + %l1], %l3, %tie_ldx(sl1)
148 add %g7, %l3, %l3, %tie_add(sl1)
151 /* IE -> LE against hidden var */
152 sethi %tie_hi22(sh1), %o1
153 add %o1, %tie_lo10(sh1), %o3
154 ldx [%l7 + %o3], %o0, %tie_ldx(sh1)
155 add %g7, %o0, %o3, %tie_add(sh1)
158 /* Direct access through %g7 */
160 /* IE against global var */
161 sethi %tie_hi22(sG5), %o3
162 add %o3, %tie_lo10(sG5), %o3
163 ldx [%l7 + %o3], %o2, %tie_ldx(sG5)
164 ldx [%g7 + %o2], %o4, %tie_add(sG5)
167 /* IE->LE against local var */
168 sethi %tie_hi22(sl5), %o3
169 add %o3, %tie_lo10(sl5), %o3
170 ldx [%l7 + %o3], %o2, %tie_ldx(sl5)
171 stb %o4, [%g7 + %o2], %tie_add(sl5)
174 /* IE->LE against hidden var */
175 sethi %tie_hi22(sh5), %o5
176 add %o5, %tie_lo10(sh5), %o3
177 ldx [%l7 + %o3], %o2, %tie_ldx(sh5)
178 ldsb [%g7 + %o2], %o4, %tie_add(sh5)