PR target/82524
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_linux_x86_64.S
blob8ff909542b681cb79bd40d2e3b08c75e8f8e1a2f
1 // This file is dual licensed under the MIT and the University of Illinois Open
2 // Source Licenses. See LICENSE.TXT for details.
4 // Avoid being marked as needing an executable stack:
5 #if defined(__linux__) && defined(__ELF__)
6 .section .note.GNU-stack,"",%progbits
7 #endif
9 // Further contents are x86_64-only:
10 #if defined(__linux__) && defined(__x86_64__)
12 #include "../builtins/assembly.h"
14 // If the "naked" function attribute were supported for x86 we could
15 // do this via inline asm.
16 .text
17 .balign 4
18 DEFINE_COMPILERRT_FUNCTION(internal_sigreturn)
19         mov           $0xf,             %eax    // 0xf == SYS_rt_sigreturn
20         mov           %rcx,             %r10
21         syscall
22         ret                                     // Won't normally reach here.
23 END_COMPILERRT_FUNCTION(internal_sigreturn)
25 #endif // defined(__linux__) && defined(__x86_64__)