diff mbox series

[22/23] linux: Use generic __syscall_error for alpha

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

Commit Message

Adhemerval Zanella Nov. 9, 2020, 8:18 p.m. UTC
Alpha __syscall_error uses an optimization to avoid load de GP
register and assumes small code size (-fpic).  Its implementation
is moved to arch-specific one (syscall_error_asm.S) to avoid
rewritting the inline asm wrapper to call the generic
__syscall_error.

Checked on alpha-linux-gnu.
---
 sysdeps/unix/alpha/Makefile                          | 8 ++++++--
 sysdeps/unix/alpha/rt-sysdep.S                       | 1 -
 sysdeps/unix/alpha/{sysdep.S => syscall_error_asm.S} | 8 ++++----
 sysdeps/unix/sysv/linux/alpha/Makefile               | 3 +--
 sysdeps/unix/sysv/linux/alpha/sysdep.h               | 4 ++--
 5 files changed, 13 insertions(+), 11 deletions(-)
 delete mode 100644 sysdeps/unix/alpha/rt-sysdep.S
 rename sysdeps/unix/alpha/{sysdep.S => syscall_error_asm.S} (94%)
diff mbox series

Patch

diff --git a/sysdeps/unix/alpha/Makefile b/sysdeps/unix/alpha/Makefile
index 0660847f15..823ff2d90f 100644
--- a/sysdeps/unix/alpha/Makefile
+++ b/sysdeps/unix/alpha/Makefile
@@ -1,4 +1,8 @@ 
+ifeq ($(subdir),csu)
+sysdep_routines += syscall_error_asm
+endif
+
 ifeq ($(subdir),rt)
-librt-sysdep_routines += rt-sysdep
-librt-shared-only-routines += rt-sysdep
+librt-routines += syscall_error_asm
+librt-shared-only-routines += syscall_error_asm
 endif
diff --git a/sysdeps/unix/alpha/rt-sysdep.S b/sysdeps/unix/alpha/rt-sysdep.S
deleted file mode 100644
index f966bf1e59..0000000000
--- a/sysdeps/unix/alpha/rt-sysdep.S
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdep.S>
diff --git a/sysdeps/unix/alpha/sysdep.S b/sysdeps/unix/alpha/syscall_error_asm.S
similarity index 94%
rename from sysdeps/unix/alpha/sysdep.S
rename to sysdeps/unix/alpha/syscall_error_asm.S
index 67968623ac..ddc86c56d6 100644
--- a/sysdeps/unix/alpha/sysdep.S
+++ b/sysdeps/unix/alpha/syscall_error_asm.S
@@ -35,9 +35,9 @@ 
 #endif
 
 	.align 4
-	.globl	__syscall_error
-	.ent	__syscall_error
-__syscall_error:
+	.globl	__syscall_error_asm
+	.ent	__syscall_error_asm
+__syscall_error_asm:
 	/* When building a shared library, we branch here without having
 	   loaded the GP.  Nor, since it was a direct branch, have we
 	   loaded PV with our address.
@@ -62,4 +62,4 @@  __syscall_error:
 	stl	t0, 0(t1)
 	ret
 
-	.end __syscall_error
+	.end __syscall_error_asm
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index 92484bbe65..20c673b644 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -31,8 +31,7 @@  libm-routines += multc3 divtc3
 endif   # math
 
 ifeq ($(subdir),nptl)
-# pull in __syscall_error routine, sigaction stubs.
-libpthread-routines += sysdep rt_sigaction
+libpthread-routines += rt_sigaction
 libpthread-shared-only-routines += sysdep rt_sigaction
 endif
 
diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h
index 7daf445068..86bab2ed4c 100644
--- a/sysdeps/unix/sysv/linux/alpha/sysdep.h
+++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h
@@ -102,14 +102,14 @@  $syscall_error:					\
 	ret
 # define SYSCALL_ERROR_FALLTHRU
 #elif defined(PIC)
-# define SYSCALL_ERROR_LABEL		__syscall_error !samegp
+# define SYSCALL_ERROR_LABEL		__syscall_error_asm !samegp
 # define SYSCALL_ERROR_HANDLER
 # define SYSCALL_ERROR_FALLTHRU		br SYSCALL_ERROR_LABEL
 #else
 # define SYSCALL_ERROR_LABEL		$syscall_error
 # define SYSCALL_ERROR_HANDLER			\
 $syscall_error:					\
-	jmp $31, __syscall_error
+	jmp $31, __syscall_error_asm
 # define SYSCALL_ERROR_FALLTHRU
 #endif /* RTLD_PRIVATE_ERRNO */