ld: Extract _bfd_elf_link_iterate_on_relocs
[binutils-gdb.git] / ld / testsuite / ld-i386 / tls-gd1.S
1 .text
2 .p2align 4,,15
3 .globl get_gd
4 .type get_gd, @function
5 get_gd:
6 pushl %ebx
7 call __x86.get_pc_thunk.bx
8 addl $_GLOBAL_OFFSET_TABLE_, %ebx
9 subl $8, %esp
10 leal gd@tlsgd(,%ebx,1), %eax
11 call ___tls_get_addr@PLT
12 addl $8, %esp
13 popl %ebx
14 ret
15 .size get_gd, .-get_gd
16 .p2align 4,,15
17 .globl set_gd
18 .type set_gd, @function
19 set_gd:
20 pushl %ebx
21 call __x86.get_pc_thunk.bx
22 addl $_GLOBAL_OFFSET_TABLE_, %ebx
23 subl $8, %esp
24 leal gd@tlsgd(%ebx), %eax
25 call ___tls_get_addr@PLT
26 nop
27 movl 16(%esp), %edx
28 movl %edx, (%eax)
29 addl $8, %esp
30 popl %ebx
31 ret
32 .size set_gd, .-set_gd
33 .text
34 .p2align 4,,15
35 .globl test_gd
36 .type test_gd, @function
37 test_gd:
38 call __x86.get_pc_thunk.cx
39 addl $_GLOBAL_OFFSET_TABLE_, %ecx
40 subl $12, %esp
41 leal gd@tlsgd(%ecx), %eax
42 call *___tls_get_addr@GOT(%ecx)
43 movl 16(%esp), %ecx
44 cmpl %ecx, (%eax)
45 sete %al
46 addl $12, %esp
47 movzbl %al, %eax
48 ret
49 .size test_gd, .-test_gd
50 .section .text,"axG",@progbits,__x86.get_pc_thunk.bx,comdat,unique,1
51 .globl __x86.get_pc_thunk.bx
52 .hidden __x86.get_pc_thunk.bx
53 .type __x86.get_pc_thunk.bx, @function
54 __x86.get_pc_thunk.bx:
55 movl (%esp), %ebx
56 ret
57 .section .text,"axG",@progbits,__x86.get_pc_thunk.cx,comdat,unique,2
58 .globl __x86.get_pc_thunk.cx
59 .hidden __x86.get_pc_thunk.cx
60 .type __x86.get_pc_thunk.cx, @function
61 __x86.get_pc_thunk.cx:
62 movl (%esp), %ecx
63 ret
64 .section .note.GNU-stack,"",@progbits