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
8sg1:	.word 17
9sg2:	.word 18
10sg3:	.word 19
11sg4:	.word 20
12sg5:	.word 21
13sg6:	.word 22
14sg7:	.word 23
15sg8:	.word 24
16sl1:	.word 65
17sl2:	.word 66
18sl3:	.word 67
19sl4:	.word 68
20sl5:	.word 69
21sl6:	.word 70
22sl7:	.word 71
23sl8:	.word 72
24sh1:	.word 257
25sh2:	.word 258
26sh3:	.word 259
27sh4:	.word 260
28sh5:	.word 261
29sh6:	.word 262
30sh7:	.word 263
31sh8:	.word 264
32	.text
33	.align	4096
34.LLGETPC0:
35        retl
36        add     %o7, %l7, %l7
37
38	.globl	fn2
39	.type	fn2,#function
40	.proc	04
41fn2:
42	save	%sp, -160, %sp
43	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7
44	call	.LLGETPC0
45	add	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
46	nop;nop;nop;nop
47
48	/* GD -> IE because variable is not defined in executable */
49	sethi	%tgd_hi22(sG1), %l1
50	nop
51	add	%l1, %tgd_lo10(sG1), %l2
52	nop
53	add	%l7, %l2, %o0, %tgd_add(sG1)
54	nop
55	call	__tls_get_addr, %tgd_call(sG1)
56	nop
57	nop;nop;nop;nop
58
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)
65	nop
66	nop;nop;nop;nop
67
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)
73	nop
74	nop;nop;nop;nop
75
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)
81	nop
82	nop;nop;nop;nop
83
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)
89	nop
90	nop;nop;nop;nop
91
92	/* LD -> LE */
93	sethi	%tldm_hi22(sl1), %l1
94	nop
95	add	%l1, %tldm_lo10(sl1), %l2
96	nop
97	add	%l7, %l2, %o0, %tldm_add(sl1)
98	nop
99	call	__tls_get_addr, %tldm_call(sl1)
100	nop
101	sethi	%tldo_hix22(sl1), %l3
102	nop
103	xor	%l3, %tldo_lox10(sl1), %l4
104	nop
105	add	%o0, %l4, %l5, %tldo_add(sl1)
106	nop
107	sethi	%tldo_hix22(sl2 + 2), %l2
108	nop
109	xor	%l2, %tldo_lox10(sl2 + 2), %l3
110	nop
111	lduh	[%o0 + %l3], %l6, %tldo_add(sl2 + 2)
112	nop;nop;nop;nop
113
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)
125	nop;nop;nop;nop
126
127	/* IE against global var  */
128	sethi	%tie_hi22(sG2), %l1
129	nop
130	add	%l1, %tie_lo10(sG2), %l2
131	nop
132	ldx	[%l7 + %l2], %l2, %tie_ldx(sG2)
133	nop
134	add	%g7, %l2, %l2, %tie_add(sG2)
135	nop;nop;nop;nop
136
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)
142	nop;nop;nop;nop
143
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)
149	nop;nop;nop;nop
150
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)
156	nop;nop;nop;nop
157
158	/* Direct access through %g7  */
159
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)
165	nop;nop;nop;nop
166
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)
172	nop;nop;nop;nop
173
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)
179	nop;nop;nop;nop
180
181	return	%i7 + 8
182	nop
183