* elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
[binutils.git] / gas / testsuite / gas / i386 / tlsd.s
blob9ce01ec708d8e657dbac0141669d64723cddd4c9
1 .section ".tdata", "awT", @progbits
2 .globl foo, baz
3 .hidden baz
4 foo: .long 25
5 bar: .long 27
6 baz: .long 29
7 .text
8 .globl fn
9 .type fn,@function
10 fn:
11 pushl %ebp
12 movl %esp, %ebp
13 pushl %ebx
14 pushl %eax
15 call 1f
16 1: popl %ebx
17 addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
19 /* Dynamic TLS model, foo not known to be in the current object */
20 leal foo@TLSGD(,%ebx,1), %eax
21 call ___tls_get_addr@PLT
22 /* %eax now contains &foo */
24 /* Dynamic TLS model, bar and baz known to be in the current object */
25 leal bar@TLSLDM(%ebx), %eax
26 call ___tls_get_addr@PLT
28 /* Just show that there can be arbitrary instructions here */
29 leal 0(%edi, 1), %edi
31 leal bar@DTPOFF(%eax), %edx
32 /* %edx now contains &bar */
34 /* Again, arbitrary instructions */
35 leal 0(%esi, 1), %esi
37 leal baz@DTPOFF(%eax), %ecx
38 /* %ecx now contains &baz */
40 movl -4(%ebp), %ebx
41 leave
42 ret