From 4906e5653c57d49f94940f28556009a88c42a583 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 4 Oct 2013 14:55:30 -0700 Subject: [PATCH] Add arch-x86_64/bionic. This is basically half of I5de76f6c46ac87779f207d568a86bb453e2414de from Pavel Chupin , but with the stock upstream setjump/sigsetjmp and H.J. Lu's suggested changes to __rt_sigreturn. Change-Id: I8167ec228faeb2065391e5bec0413cca662f3d33 --- libc/SYSCALLS.TXT | 2 +- libc/arch-x86_64/bionic/__get_sp.S | 34 +++++++ libc/arch-x86_64/bionic/__get_tls.c | 33 ++++++ libc/arch-x86_64/bionic/__rt_sigreturn.S | 36 +++++++ libc/arch-x86_64/bionic/__set_tls.c | 38 +++++++ .../arch-x86_64/bionic/_exit_with_stack_teardown.S | 56 +++++++++++ libc/arch-x86_64/bionic/_setjmp.S | 82 +++++++++++++++ libc/arch-x86_64/bionic/clone.S | 111 +++++++++++++++++++++ libc/arch-x86_64/bionic/futex_x86_64.S | 67 +++++++++++++ libc/arch-x86_64/bionic/setjmp.S | 103 +++++++++++++++++++ libc/arch-x86_64/bionic/sigaction.c | 52 ++++++++++ libc/arch-x86_64/bionic/sigprocmask.c | 35 +++++++ libc/arch-x86_64/bionic/sigsetjmp.S | 107 ++++++++++++++++++++ libc/arch-x86_64/bionic/sigsuspend.c | 35 +++++++ libc/arch-x86_64/bionic/syscall.S | 65 ++++++++++++ libc/arch-x86_64/syscalls.mk | 2 +- .../syscalls/{arch_prctl.S => __arch_prctl.S} | 4 +- libc/arch-x86_64/x86_64.mk | 15 +-- 18 files changed, 866 insertions(+), 11 deletions(-) create mode 100644 libc/arch-x86_64/bionic/__get_sp.S create mode 100644 libc/arch-x86_64/bionic/__get_tls.c create mode 100644 libc/arch-x86_64/bionic/__rt_sigreturn.S create mode 100644 libc/arch-x86_64/bionic/__set_tls.c create mode 100644 libc/arch-x86_64/bionic/_exit_with_stack_teardown.S create mode 100644 libc/arch-x86_64/bionic/_setjmp.S create mode 100644 libc/arch-x86_64/bionic/clone.S create mode 100644 libc/arch-x86_64/bionic/futex_x86_64.S create mode 100644 libc/arch-x86_64/bionic/setjmp.S create mode 100644 libc/arch-x86_64/bionic/sigaction.c create mode 100644 libc/arch-x86_64/bionic/sigprocmask.c create mode 100644 libc/arch-x86_64/bionic/sigsetjmp.S create mode 100644 libc/arch-x86_64/bionic/sigsuspend.c create mode 100644 libc/arch-x86_64/bionic/syscall.S rename libc/arch-x86_64/syscalls/{arch_prctl.S => __arch_prctl.S} (88%) diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 6465de477..b61340181 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -94,7 +94,7 @@ int chroot(const char*) all # IMPORTANT: Even though declares prctl(int, ...), the syscall stub must take 6 arguments # to match the kernel implementation. int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) all -long arch_prctl(int, unsigned long) x86_64 +long __arch_prctl:arch_prctl(int, unsigned long) x86_64 int capget(cap_user_header_t header, cap_user_data_t data) all int capset(cap_user_header_t header, const cap_user_data_t data) all int sigaltstack(const stack_t*, stack_t*) all diff --git a/libc/arch-x86_64/bionic/__get_sp.S b/libc/arch-x86_64/bionic/__get_sp.S new file mode 100644 index 000000000..0c693b3ed --- /dev/null +++ b/libc/arch-x86_64/bionic/__get_sp.S @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +ENTRY(__get_sp) + mov %rsp, %rax + ret +END(__get_sp) diff --git a/libc/arch-x86_64/bionic/__get_tls.c b/libc/arch-x86_64/bionic/__get_tls.c new file mode 100644 index 000000000..f21b6b8c8 --- /dev/null +++ b/libc/arch-x86_64/bionic/__get_tls.c @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +void* __get_tls(void) { + void* tls; + asm ("mov %%fs:0, %0" : "=r"(tls)); + return tls; +} diff --git a/libc/arch-x86_64/bionic/__rt_sigreturn.S b/libc/arch-x86_64/bionic/__rt_sigreturn.S new file mode 100644 index 000000000..e03bb88d3 --- /dev/null +++ b/libc/arch-x86_64/bionic/__rt_sigreturn.S @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +ENTRY(__rt_sigreturn) + .hidden _C_LABEL(__rt_sigreturn) // TODO: add an ENTRY_PRIVATE macro for x86_64. + movl $__NR_rt_sigreturn, %eax + syscall +END(__rt_sigreturn) diff --git a/libc/arch-x86_64/bionic/__set_tls.c b/libc/arch-x86_64/bionic/__set_tls.c new file mode 100644 index 000000000..9a694494b --- /dev/null +++ b/libc/arch-x86_64/bionic/__set_tls.c @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +extern int __arch_prctl(int, unsigned long); + +int __set_tls(void* ptr) { + // We also need to write the location of the tls to ptr[0]. + *(void**) ptr = ptr; + return __arch_prctl(ARCH_SET_FS, (uintptr_t) ptr); +} diff --git a/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S b/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S new file mode 100644 index 000000000..66105f247 --- /dev/null +++ b/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +/* + * void _exit_with_stack_teardown(void *stackBase, int stackSize, int *retCode) + */ + +ENTRY(_exit_with_stack_teardown) + /* we can trash %rbx here since this call should never return. */ + /* We can also take advantage of the fact that the linux syscall trap + * handler saves all the registers, so we don't need a stack to keep + * the retCode argument for exit while doing the munmap */ + + /* TODO(dmtriyz): No one expects this code to return, so even if + * munmap fails, we have to exit. This should probably be fixed, but + * since ARM side does the same thing, leave it as is. + */ + + /* args passed through registers */ + mov $__NR_munmap, %eax /* shouldn't change %rdx (retCode) */ + syscall + mov %rdx, %rdi /* retrieve the retCode */ + mov $__NR_exit, %eax + syscall + /* exit does not return */ + /* can't have a ret here since we no longer have a usable stack. Seems + * that presently, 'hlt' will cause the program to segfault.. but this + * should never happen :) */ + hlt diff --git a/libc/arch-x86_64/bionic/_setjmp.S b/libc/arch-x86_64/bionic/_setjmp.S new file mode 100644 index 000000000..d9a59f7aa --- /dev/null +++ b/libc/arch-x86_64/bionic/_setjmp.S @@ -0,0 +1,82 @@ +/* $OpenBSD: _setjmp.S,v 1.1 2004/01/28 01:44:45 mickey Exp $ */ +/* $NetBSD: _setjmp.S,v 1.1 2001/06/19 00:25:02 fvdl Exp $ */ + +/* + * Copyright (c) 2001 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Frank van der Linden for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +#include + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v)" from the last call to + * _setjmp(a) + * by restoring registers from the stack. + * The previous signal state is NOT restored. + */ + +ENTRY(_setjmp) + movq (%rsp),%r11 + movq %rbx,(_JB_RBX * 8)(%rdi) + movq %rbp,(_JB_RBP * 8)(%rdi) + movq %r12,(_JB_R12 * 8)(%rdi) + movq %r13,(_JB_R13 * 8)(%rdi) + movq %r14,(_JB_R14 * 8)(%rdi) + movq %r15,(_JB_R15 * 8)(%rdi) + movq %rsp,(_JB_RSP * 8)(%rdi) + movq %r11,(_JB_PC * 8)(%rdi) + + xorl %eax,%eax + ret + +ENTRY(_longjmp) + movq (_JB_RBX * 8)(%rdi),%rbx + movq (_JB_RBP * 8)(%rdi),%rbp + movq (_JB_R12 * 8)(%rdi),%r12 + movq (_JB_R13 * 8)(%rdi),%r13 + movq (_JB_R14 * 8)(%rdi),%r14 + movq (_JB_R15 * 8)(%rdi),%r15 + movq (_JB_RSP * 8)(%rdi),%rsp + movq (_JB_PC * 8)(%rdi),%r11 + + movl %esi,%eax + testl %eax,%eax + jnz 1f + incl %eax +1: movq %r11,0(%rsp) + ret diff --git a/libc/arch-x86_64/bionic/clone.S b/libc/arch-x86_64/bionic/clone.S new file mode 100644 index 000000000..df2929eba --- /dev/null +++ b/libc/arch-x86_64/bionic/clone.S @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +// int __pthread_clone(void* (*fn)(void*), void* tls, int flags, void* arg); +ENTRY(__pthread_clone) + # save tls + movq %rsi, %r11 + # 16-byte alignment on child stack + andq $~15, %rsi + + # insert arguments onto the child stack + movq %rdi, -32(%rsi) + movq %rcx, -24(%rsi) + movq %r11, -16(%rsi) + + subq $32, %rsi + movq %rdx, %rdi + movl $__NR_clone, %eax + syscall + testl %eax, %eax + jns 1f + + # an error occurred, set errno and return -1 + negl %eax + movl %eax, %edi + call __set_errno + orl $-1, %eax + jmp 2f +1: + jnz 2f + + # we're in the child thread now, call __thread_entry + # with the appropriate arguments on the child stack + # we already placed most of them + call __thread_entry + hlt +2: + ret + +/* + * int __bionic_clone(unsigned long clone_flags, + * void* newsp, + * int *parent_tidptr, + * void *new_tls, + * int *child_tidptr, + * int (*fn)(void *), + * void *arg); + */ +ENTRY(__bionic_clone) + # insert arguments onto the child stack + andq $~15, %rsi + movq %r9, -16(%rsi) + # 7th argument (arg) goes through stack + movq 8(%rsp), %rax + movq %rax, -8(%rsi) + + subq $16, %rsi + movq %r8, %r10 + movq %rcx, %r8 + movl $__NR_clone, %eax + syscall + testl %eax, %eax + jns 1f + + # an error occurred, set errno and return -1 + negl %eax + movl %eax, %edi + call __set_errno + orl $-1, %eax + jmp 2f + +1: + jnz 2f + + # we're in the child now, call __bionic_clone_entry + # with the appropriate arguments on the child stack + # we already placed most of them + call __bionic_clone_entry + hlt + +2: + ret + diff --git a/libc/arch-x86_64/bionic/futex_x86_64.S b/libc/arch-x86_64/bionic/futex_x86_64.S new file mode 100644 index 000000000..d94792edc --- /dev/null +++ b/libc/arch-x86_64/bionic/futex_x86_64.S @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 + +/* + * int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout) + */ +ENTRY(__futex_wait) + mov %rdx, %r10 /* timeout */ + mov %esi, %edx /* val */ + mov $FUTEX_WAIT, %esi /* op */ + mov $__NR_futex, %eax + syscall + ret + + +/* int __futex_wake(volatile void *ftx, int count) */ + +ENTRY(__futex_wake) + mov %esi, %edx + mov $FUTEX_WAKE, %esi + mov $__NR_futex, %eax + syscall + ret + +/* int __futex_syscall3(volatile void *ftx, int op, int count) */ +ENTRY(__futex_syscall3) + mov $__NR_futex, %eax + syscall + ret + +/* int __futex_syscall4(volatile void *ftx, int op, int val, const struct timespec *timeout) */ +ENTRY(__futex_syscall4) + mov %rcx, %r10 /* timeout */ + mov $__NR_futex, %eax + syscall + ret diff --git a/libc/arch-x86_64/bionic/setjmp.S b/libc/arch-x86_64/bionic/setjmp.S new file mode 100644 index 000000000..1641add9a --- /dev/null +++ b/libc/arch-x86_64/bionic/setjmp.S @@ -0,0 +1,103 @@ +/* $OpenBSD: setjmp.S,v 1.3 2012/08/22 17:19:34 pascal Exp $ */ +/* $NetBSD: __setjmp14.S,v 1.1 2001/06/19 00:25:02 fvdl Exp $ */ + +/* + * Copyright (c) 2001 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Frank van der Linden for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +#include + +/* + * C library -- _setjmp, _longjmp + * + * longjmp(a,v) + * will generate a "return(v)" from the last call to + * setjmp(a) + * by restoring registers from the stack. + * The previous signal state is restored. + */ + +ENTRY(setjmp) + pushq %rdi + xorq %rdi,%rdi +#ifdef __PIC__ + call PIC_PLT(_C_LABEL(sigblock)) +#else + call _C_LABEL(sigblock) +#endif + popq %rdi + movq %rax,(_JB_SIGMASK * 8)(%rdi) + + movq (%rsp),%r11 + movq %rbx,(_JB_RBX * 8)(%rdi) + movq %rbp,(_JB_RBP * 8)(%rdi) + movq %r12,(_JB_R12 * 8)(%rdi) + movq %r13,(_JB_R13 * 8)(%rdi) + movq %r14,(_JB_R14 * 8)(%rdi) + movq %r15,(_JB_R15 * 8)(%rdi) + movq %rsp,(_JB_RSP * 8)(%rdi) + movq %r11,(_JB_PC * 8)(%rdi) + +2: xorl %eax,%eax + ret + +ENTRY(longjmp) + movq %rdi,%r12 + movl %esi,%r8d + + movq (_JB_SIGMASK * 8)(%rdi),%rdi + pushq %r8 +#ifdef __PIC__ + call PIC_PLT(_C_LABEL(sigsetmask)) +#else + call _C_LABEL(sigsetmask) +#endif + popq %r8 + movq (_JB_RBX * 8)(%r12),%rbx + movq (_JB_RBP * 8)(%r12),%rbp + movq (_JB_R13 * 8)(%r12),%r13 + movq (_JB_R14 * 8)(%r12),%r14 + movq (_JB_R15 * 8)(%r12),%r15 + movq (_JB_RSP * 8)(%r12),%rsp + movq (_JB_PC * 8)(%r12),%r11 + movq (_JB_R12 * 8)(%r12),%r12 + + movl %r8d,%eax + testl %eax,%eax + jnz 1f + incl %eax +1: movq %r11,0(%rsp) + ret diff --git a/libc/arch-x86_64/bionic/sigaction.c b/libc/arch-x86_64/bionic/sigaction.c new file mode 100644 index 000000000..d5622bee0 --- /dev/null +++ b/libc/arch-x86_64/bionic/sigaction.c @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +extern void __rt_sigreturn(void); +extern int __rt_sigaction(int, const struct sigaction*, struct sigaction*, size_t); + +int sigaction(int sig, const struct sigaction* act, struct sigaction* old_act) { + struct sigaction sa; + + if (act != NULL && !(act->sa_flags & SA_RESTORER)) { + sa = *act; + act = &sa; + sa.sa_flags |= SA_RESTORER; + sa.sa_restorer = &__rt_sigreturn; + } + + int result = __rt_sigaction(sig, act, old_act, sizeof(sigset_t)); + + if (old_act != NULL && (old_act->sa_restorer == &__rt_sigreturn)) { + old_act->sa_flags &= ~SA_RESTORER; + } + + return result; +} + diff --git a/libc/arch-x86_64/bionic/sigprocmask.c b/libc/arch-x86_64/bionic/sigprocmask.c new file mode 100644 index 000000000..cdafa083e --- /dev/null +++ b/libc/arch-x86_64/bionic/sigprocmask.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +extern int __rt_sigprocmask(int, const sigset_t*, sigset_t*, size_t); + +int sigprocmask(int how, const sigset_t* set, sigset_t* old_set) { + return __rt_sigprocmask(how, set, old_set, sizeof(sigset_t)); +} diff --git a/libc/arch-x86_64/bionic/sigsetjmp.S b/libc/arch-x86_64/bionic/sigsetjmp.S new file mode 100644 index 000000000..51b055a0f --- /dev/null +++ b/libc/arch-x86_64/bionic/sigsetjmp.S @@ -0,0 +1,107 @@ +/* $OpenBSD: sigsetjmp.S,v 1.3 2012/08/22 17:19:34 pascal Exp $ */ +/* $NetBSD: __setjmp14.S,v 1.1 2001/06/19 00:25:02 fvdl Exp $ */ + +/* + * Copyright (c) 2001 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Frank van der Linden for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +#include + +/* + * C library -- _setjmp, _longjmp + * + * longjmp(a,v) + * will generate a "return(v)" from the last call to + * setjmp(a) + * by restoring registers from the stack. + * The previous signal state is restored. + */ + +ENTRY(sigsetjmp) + movl %esi,(_JB_SIGFLAG * 8)(%rdi) + testl %esi,%esi + jz 2f + + pushq %rdi + xorq %rdi,%rdi +#ifdef __PIC__ + call PIC_PLT(_C_LABEL(sigblock)) +#else + call _C_LABEL(sigblock) +#endif + popq %rdi + movq %rax,(_JB_SIGMASK * 8)(%rdi) + +2: movq (%rsp),%r11 + movq %rbx,(_JB_RBX * 8)(%rdi) + movq %rbp,(_JB_RBP * 8)(%rdi) + movq %r12,(_JB_R12 * 8)(%rdi) + movq %r13,(_JB_R13 * 8)(%rdi) + movq %r14,(_JB_R14 * 8)(%rdi) + movq %r15,(_JB_R15 * 8)(%rdi) + movq %rsp,(_JB_RSP * 8)(%rdi) + movq %r11,(_JB_PC * 8)(%rdi) + +2: xorl %eax,%eax + ret + +ENTRY(siglongjmp) + movq %rdi,%r12 + pushq %rsi + cmpl $0, (_JB_SIGFLAG * 8)(%rdi) + jz 2f + + movq (_JB_SIGMASK * 8)(%rdi),%rdi +#ifdef __PIC__ + call PIC_PLT(_C_LABEL(sigsetmask)) +#else + call _C_LABEL(sigsetmask) +#endif +2: popq %rax + movq (_JB_RBX * 8)(%r12),%rbx + movq (_JB_RBP * 8)(%r12),%rbp + movq (_JB_R13 * 8)(%r12),%r13 + movq (_JB_R14 * 8)(%r12),%r14 + movq (_JB_R15 * 8)(%r12),%r15 + movq (_JB_RSP * 8)(%r12),%rsp + movq (_JB_PC * 8)(%r12),%r11 + movq (_JB_R12 * 8)(%r12),%r12 + + testl %eax,%eax + jnz 1f + incl %eax +1: movq %r11,0(%rsp) + ret diff --git a/libc/arch-x86_64/bionic/sigsuspend.c b/libc/arch-x86_64/bionic/sigsuspend.c new file mode 100644 index 000000000..40bfaeaea --- /dev/null +++ b/libc/arch-x86_64/bionic/sigsuspend.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +extern int __rt_sigsuspend(const sigset_t*, size_t); + +int sigsuspend(const sigset_t* set) { + return __rt_sigsuspend(set, sizeof(sigset_t)); +} diff --git a/libc/arch-x86_64/bionic/syscall.S b/libc/arch-x86_64/bionic/syscall.S new file mode 100644 index 000000000..6b84ba4f3 --- /dev/null +++ b/libc/arch-x86_64/bionic/syscall.S @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Generic syscall call. + * Upon entry: + * %rax: system call number + * %rdi: arg0 to system call + * %rsi: arg1 + * %rdx: arg2 + * %rcx: arg3 - syscall expects it at %r10 + * %r8: arg4 + * %r9: arg5 + */ + +#include +#include +#include + +ENTRY(syscall) + # All arguments are passed via registers. + # (Not all will be valid, depending on the syscall.) + mov %edi, %eax + mov %rsi, %rdi + mov %rdx, %rsi + mov %rcx, %rdx + mov %r8, %r10 + mov %r9, %r8 + mov 8(%rsp), %r9 + + # Make the system call. + syscall + cmpq $-MAX_ERRNO, %rax + jb 1f + negl %eax + movl %eax, %edi + call __set_errno + orq $-1, %rax +1: + ret diff --git a/libc/arch-x86_64/syscalls.mk b/libc/arch-x86_64/syscalls.mk index 5a7a88071..08fdf3861 100644 --- a/libc/arch-x86_64/syscalls.mk +++ b/libc/arch-x86_64/syscalls.mk @@ -41,7 +41,7 @@ syscall_src += arch-x86_64/syscalls/vfork.S syscall_src += arch-x86_64/syscalls/setregid.S syscall_src += arch-x86_64/syscalls/chroot.S syscall_src += arch-x86_64/syscalls/prctl.S -syscall_src += arch-x86_64/syscalls/arch_prctl.S +syscall_src += arch-x86_64/syscalls/__arch_prctl.S syscall_src += arch-x86_64/syscalls/capget.S syscall_src += arch-x86_64/syscalls/capset.S syscall_src += arch-x86_64/syscalls/sigaltstack.S diff --git a/libc/arch-x86_64/syscalls/arch_prctl.S b/libc/arch-x86_64/syscalls/__arch_prctl.S similarity index 88% rename from libc/arch-x86_64/syscalls/arch_prctl.S rename to libc/arch-x86_64/syscalls/__arch_prctl.S index eaf9494d0..21d154c8b 100644 --- a/libc/arch-x86_64/syscalls/arch_prctl.S +++ b/libc/arch-x86_64/syscalls/__arch_prctl.S @@ -3,7 +3,7 @@ #include #include -ENTRY(arch_prctl) +ENTRY(__arch_prctl) movl $__NR_arch_prctl, %eax syscall cmpq $-MAX_ERRNO, %rax @@ -14,4 +14,4 @@ ENTRY(arch_prctl) orq $-1, %rax 1: ret -END(arch_prctl) +END(__arch_prctl) diff --git a/libc/arch-x86_64/x86_64.mk b/libc/arch-x86_64/x86_64.mk index 6a2bb9c4f..d9c8f12d8 100644 --- a/libc/arch-x86_64/x86_64.mk +++ b/libc/arch-x86_64/x86_64.mk @@ -1,17 +1,18 @@ _LIBC_ARCH_COMMON_SRC_FILES := \ - arch-x86_64/bionic/__get_sp.S \ - arch-x86_64/bionic/__get_tls.c \ - arch-x86_64/bionic/__set_tls.c \ arch-x86_64/bionic/clone.S \ arch-x86_64/bionic/_exit_with_stack_teardown.S \ arch-x86_64/bionic/futex_x86_64.S \ - arch-x86_64/bionic/setjmp.S \ + arch-x86_64/bionic/__get_sp.S \ + arch-x86_64/bionic/__get_tls.c \ + arch-x86_64/bionic/__rt_sigreturn.S \ arch-x86_64/bionic/_setjmp.S \ - arch-x86_64/bionic/sigsetjmp.S \ - arch-x86_64/bionic/syscall.S \ - arch-x86_64/bionic/sigprocmask.c \ + arch-x86_64/bionic/setjmp.S \ + arch-x86_64/bionic/__set_tls.c \ arch-x86_64/bionic/sigaction.c \ + arch-x86_64/bionic/sigprocmask.c \ + arch-x86_64/bionic/sigsetjmp.S \ arch-x86_64/bionic/sigsuspend.c \ + arch-x86_64/bionic/syscall.S \ _LIBC_ARCH_STATIC_SRC_FILES := \ bionic/dl_iterate_phdr_static.c \ -- 2.11.0