x86: Add a GNU_PROPERTY_X86_ISA_1_USED note if needed
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / linux-x86.S
1 .text
2 .globl _start
3 .type _start,@function
4 .p2align 4
5 _start:
6 xorl %ebp, %ebp
7 #ifdef __LP64__
8 popq %rdi
9 movq %rsp, %rsi
10 andq $~15, %rsp
11 #elif defined __x86_64__
12 mov (%rsp),%edi
13 addl $4,%esp
14 movl %esp, %esi
15 andl $~15, %esp
16 #else
17 popl %esi
18 movl %esp, %ecx
19 andl $~15, %esp
20
21 subl $8,%esp
22 pushl %ecx
23 pushl %esi
24 #endif
25
26 call main
27
28 hlt
29
30 .type syscall, @function
31 .globl syscall
32 .p2align 4
33 syscall:
34 #ifdef __x86_64__
35 movq %rdi, %rax /* Syscall number -> rax. */
36 movq %rsi, %rdi /* shift arg1 - arg5. */
37 movq %rdx, %rsi
38 movq %rcx, %rdx
39 movq %r8, %r10
40 movq %r9, %r8
41 movq 8(%rsp),%r9 /* arg6 is on the stack. */
42 syscall /* Do the system call. */
43 #else
44 push %ebp
45 push %edi
46 push %esi
47 push %ebx
48 mov 0x2c(%esp),%ebp
49 mov 0x28(%esp),%edi
50 mov 0x24(%esp),%esi
51 mov 0x20(%esp),%edx
52 mov 0x1c(%esp),%ecx
53 mov 0x18(%esp),%ebx
54 mov 0x14(%esp),%eax
55 int $0x80
56 pop %ebx
57 pop %esi
58 pop %edi
59 pop %ebp
60 #endif
61 ret /* Return to caller. */
62 .size syscall, .-syscall
63 .section .note.GNU-stack,"",@progbits
This page took 0.042872 seconds and 5 git commands to generate.