Commit | Line | Data |
---|---|---|
bb363086 | 1 | .section .tbss,"awT",@nobits |
c20c30f6 | 2 | .global tls_gd |
bb363086 EB |
3 | .align 4 |
4 | .type tls_gd, #object | |
5 | .size tls_gd, 4 | |
6 | tls_gd: | |
c20c30f6 EB |
7 | .skip 4 |
8 | .global tls_ld | |
9 | .align 4 | |
10 | .type tls_ld, #object | |
11 | .size tls_ld, 4 | |
12 | tls_ld: | |
13 | .skip 4 | |
14 | .global tls_ie | |
15 | .align 4 | |
16 | .type tls_ie, #object | |
17 | .size tls_ie, 4 | |
18 | tls_ie: | |
bb363086 EB |
19 | .skip 4 |
20 | .section ".text" | |
c20c30f6 EB |
21 | .LLGETPC0: |
22 | retl | |
23 | add %o7, %l7, %l7 | |
bb363086 | 24 | .align 4 |
c20c30f6 EB |
25 | .global foo |
26 | .type foo, #function | |
bb363086 | 27 | .proc 0104 |
c20c30f6 EB |
28 | foo: |
29 | save %sp, -160, %sp | |
30 | sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7 | |
31 | call .LLGETPC0 | |
32 | add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7 | |
33 | nop;nop;nop;nop | |
34 | ||
35 | /* GD -> IE with global variable not defined in executable */ | |
36 | sethi %tgd_hi22(sG1), %g1 | |
37 | add %g1, %tgd_lo10(sG1), %g1 | |
38 | add %l7, %g1, %o0, %tgd_add(sG1) | |
39 | call __tls_get_addr, %tgd_call(sG1) | |
40 | nop | |
41 | nop;nop;nop;nop | |
42 | ||
43 | /* GD -> LE with global variable defined in executable */ | |
bb363086 EB |
44 | sethi %tgd_hi22(tls_gd), %g1 |
45 | add %g1, %tgd_lo10(tls_gd), %g1 | |
46 | add %l7, %g1, %o0, %tgd_add(tls_gd) | |
47 | call __tls_get_addr, %tgd_call(tls_gd) | |
48 | nop | |
c20c30f6 EB |
49 | nop;nop;nop;nop |
50 | ||
51 | /* LD -> LE with global variable defined in executable */ | |
52 | sethi %tldm_hi22(tls_ld), %g1 | |
53 | add %g1, %tldm_lo10(tls_ld), %g1 | |
54 | add %l7, %g1, %o0, %tldm_add(tls_ld) | |
55 | call __tls_get_addr, %tldm_call(tls_ld) | |
56 | nop | |
57 | sethi %tldo_hix22(tls_ld), %g1 | |
58 | xor %g1, %tldo_lox10(tls_ld), %g1 | |
59 | add %o0, %g1, %g1, %tldo_add(tls_ld) | |
60 | nop;nop;nop;nop | |
61 | ||
62 | /* IE -> LE with global variable defined in executable */ | |
63 | sethi %tie_hi22(tls_ie), %g1 | |
64 | add %g1, %tie_lo10(tls_ie), %g1 | |
65 | ldx [%l7 + %g1], %g1, %tie_ldx(tls_ie) | |
66 | add %g7, %g1, %g1, %tie_add(tls_ie) | |
67 | nop;nop;nop;nop | |
68 | ||
69 | ret | |
70 | restore |