| 1 | .file 1 "tls.s" |
| 2 | .abicalls |
| 3 | .text |
| 4 | .align 2 |
| 5 | .globl fn |
| 6 | .ent fn |
| 7 | .type fn,@function |
| 8 | fn: |
| 9 | .frame $fp,16,$31 |
| 10 | .mask 0x40000000,-8 |
| 11 | .fmask 0x00000000,0 |
| 12 | .set noreorder |
| 13 | .cpload $25 |
| 14 | .set reorder |
| 15 | addiu $sp,$sp,-16 |
| 16 | sw $fp,8($sp) |
| 17 | move $fp,$sp |
| 18 | .cprestore 0 |
| 19 | |
| 20 | # General Dynamic |
| 21 | lw $25,%call16(__tls_get_addr)($28) |
| 22 | addiu $4,$28,%tlsgd(tlsvar_gd) |
| 23 | jal $25 |
| 24 | |
| 25 | # Local Dynamic |
| 26 | lw $25,%call16(__tls_get_addr)($28) |
| 27 | addiu $4,$28,%tlsldm(tlsvar_ld) |
| 28 | jal $25 |
| 29 | |
| 30 | move $2,$2 # Arbitrary instructions |
| 31 | |
| 32 | lui $3,%dtprel_hi(tlsvar_ld) |
| 33 | addiu $3,$3,%dtprel_lo(tlsvar_ld) |
| 34 | addu $3,$3,$2 |
| 35 | |
| 36 | # Initial Exec |
| 37 | .set push |
| 38 | .set mips32r2 |
| 39 | rdhwr $2, $5 |
| 40 | .set pop |
| 41 | lw $3,%gottprel(tlsvar_ie)($28) |
| 42 | addu $3,$3,$2 |
| 43 | |
| 44 | # Local Exec |
| 45 | .set push |
| 46 | .set mips32r2 |
| 47 | rdhwr $2, $5 |
| 48 | .set pop |
| 49 | lui $3,%tprel_hi(tlsvar_le) |
| 50 | ori $3,$3,%tprel_lo(tlsvar_le) |
| 51 | addu $3,$3,$2 |
| 52 | |
| 53 | move $sp,$fp |
| 54 | lw $fp,8($sp) |
| 55 | addiu $sp,$sp,16 |
| 56 | j $31 |
| 57 | .end fn |
| 58 | |
| 59 | .section .tbss,"awT",@nobits |
| 60 | .align 2 |
| 61 | .global tlsvar_gd |
| 62 | .type tlsvar_gd,@object |
| 63 | .size tlsvar_gd,4 |
| 64 | tlsvar_gd: |
| 65 | .space 4 |
| 66 | .global tlsvar_ie |
| 67 | .type tlsvar_ie,@object |
| 68 | .size tlsvar_ie,4 |
| 69 | tlsvar_ie: |
| 70 | .space 4 |
| 71 | |
| 72 | .section .tdata,"awT" |
| 73 | .align 2 |
| 74 | .global tlsvar_ld |
| 75 | .hidden tlsvar_ld |
| 76 | .type tlsvar_ld,@object |
| 77 | .size tlsvar_ld,4 |
| 78 | tlsvar_ld: |
| 79 | .word 1 |
| 80 | .global tlsvar_le |
| 81 | .hidden tlsvar_le |
| 82 | .type tlsvar_le,@object |
| 83 | .size tlsvar_le,4 |
| 84 | tlsvar_le: |
| 85 | .word 1 |