[06/23] linux: Use generic __syscall_error for aarch64

Message ID 20201109201826.120534-7-adhemerval.zanella@linaro.org
State Superseded
Headers
Series Simplify internal Linux syscall |

Commit Message

Adhemerval Zanella Nov. 9, 2020, 8:18 p.m. UTC
  The auto-generated syscalls calls the __syscall_error, although setting
using inline function generates slight less code:

--- sizes-aarch64-linux-gnu.outline
+++ sizes-aarch64-linux-gnu.inline
    text           data     bss     dec     hex filename
 1388874          19096   14520 1422490  15b49a libc.so
- 138509           7136     344  145989   23a45 elf/ld.so
-  98439           1636   16656  116731   1c7fb nptl/libpthread.so
-  23942           1236     248   25426    6352 rt/librt.so
+ 138449           7136     344  145929   23a09 elf/ld.so
+  98567           1636   16656  116859   1c87b nptl/libpthread.so
+  23918           1236     248   25402    633a rt/librt.so

Checked on aarch64-linux-gnu.
---
 sysdeps/unix/sysv/linux/aarch64/sysdep.c | 32 ------------------------
 sysdeps/unix/sysv/linux/aarch64/sysdep.h |  2 ++
 2 files changed, 2 insertions(+), 32 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/aarch64/sysdep.c
  

Patch

diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.c b/sysdeps/unix/sysv/linux/aarch64/sysdep.c
deleted file mode 100644
index 6b88f3484f..0000000000
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.c
+++ /dev/null
@@ -1,32 +0,0 @@ 
-/* Copyright (C) 2011-2020 Free Software Foundation, Inc.
-
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-
-long __syscall_error (long err);
-hidden_proto (__syscall_error)
-
-/* This routine is jumped to by all the syscall handlers, to stash
-   an error number into errno.  */
-long
-__syscall_error (long err)
-{
-  __set_errno (- err);
-  return -1;
-}
-hidden_def (__syscall_error)
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 319a7c7ac5..e1cda79449 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -19,6 +19,8 @@ 
 #ifndef _LINUX_AARCH64_SYSDEP_H
 #define _LINUX_AARCH64_SYSDEP_H 1
 
+#define SYSCALL_ERROR_FUNC
+
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/aarch64/sysdep.h>
 #include <sysdeps/unix/sysv/linux/generic/sysdep.h>