about summary refs log tree commit diff
path: root/sysdeps/unix/alpha/sysdep.S
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-11-08 02:20:41 +0000
committerRoland McGrath <roland@gnu.org>2002-11-08 02:20:41 +0000
commitc6481412ff19d5c551aba9330082a19a4a93260f (patch)
tree335acb22df9e06295318ebe74d3dc8d6dac03968 /sysdeps/unix/alpha/sysdep.S
parentdfe4c900cb1d03533702c453c3a9abe6d41e545d (diff)
downloadglibc-c6481412ff19d5c551aba9330082a19a4a93260f.tar.gz
glibc-c6481412ff19d5c551aba9330082a19a4a93260f.tar.xz
glibc-c6481412ff19d5c551aba9330082a19a4a93260f.zip
* configure.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove test.
	* configure: Regenerated.
	* config.h.in (ASM_ALPHA_NG_SYMBOL_PREFIX): Remove #undef.
	* sysdeps/alpha/dl-machine.h (TRAMPOLINE_TEMPLATE): Use !samegp.
	(RTLD_START): Likewise.  Access _dl_skip_args, _rtld_local, and
	_dl_fini via gp-relative relocations.
	* sysdeps/alpha/fpu/e_sqrt.c: Use !samegp.

	* elf/tls-macros.h: Add alpha versions.
	* sysdeps/alpha/dl-machine.h (elf_machine_rela): Handle TLS relocs.
	* sysdeps/unix/alpha/sysdep.S: Support USE___THREAD.
	* sysdeps/unix/alpha/sysdep.h: Likewise.  Add SYSCALL_ERROR_HANDLER.
	* sysdeps/unix/sysv/linux/alpha/brk.S: Use it.
	* sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/getitimer.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/rt_sigaction.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/select.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise.

	* sysdeps/unix/sysv/linux/alpha/sysdep.h: Re-include protect.
	Kill argument registers across the inline syscall.

	* sysdeps/unix/sysv/linux/alpha/clone.S: Add user_tid and tls args.

	* linuxthreads/sysdeps/alpha/tls.h: New file.
	* sysdeps/alpha/dl-tls.h: New file.
Diffstat (limited to 'sysdeps/unix/alpha/sysdep.S')
-rw-r--r--sysdeps/unix/alpha/sysdep.S58
1 files changed, 46 insertions, 12 deletions
diff --git a/sysdeps/unix/alpha/sysdep.S b/sysdeps/unix/alpha/sysdep.S
index 05c00918e6..50c84c1166 100644
--- a/sysdeps/unix/alpha/sysdep.S
+++ b/sysdeps/unix/alpha/sysdep.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1996, 1998, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Brendan Kehoe (brendan@zen.org).
 
@@ -20,24 +20,59 @@
 #include <sysdep.h>
 #include <features.h>
 
+#if defined(__ELF__) && defined(PIC)
+	/* Put this at the end of libc's text segment so that all of
+	   the direct branches from the syscalls are forward, and 
+	   thus predicted not taken.  */
+	.section .text.last, "ax", @progbits
+#else
 	.text
-	.align 2
+#endif
 
-#ifdef	_LIBC_REENTRANT
+#ifdef PIC
+	/* 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.  Do both.  */
+# define LOADGP		br pv, 1f; 1: ldgp gp, 0(pv)
+# define PROLOGUE	.prologue 0
+#else
+# define LOADGP		ldgp gp, 0(pv)
+# define PROLOGUE	.prologue 1
+#endif
 
+	.align 4
 	.globl __syscall_error
 	.ent __syscall_error
 __syscall_error:
-	ldgp	gp, 0(pv)
+
+#if defined(_LIBC_REENTRANT) && defined(USE___THREAD)
+
+	LOADGP
+	PROLOGUE
+	mov	v0, t0
+	call_pal PAL_rduniq
+	ldq	t1, __libc_errno(gp) !gottprel
+	addq	v0, t1, v0
+	stl	t0, 0(v0)
+	lda	v0, -1
+	ret
+
+#elif defined(_LIBC_REENTRANT)
+
+	LOADGP
 	lda	sp, -16(sp)
 	.frame	sp, 16, ra, 0
 	stq	ra, 0(sp)
 	stq	v0, 8(sp)
 	.mask	0x4000001, -16
-	.prologue 1
+	PROLOGUE
 
 	/* Find our per-thread errno address  */
+#ifdef PIC
+	bsr	ra, __errno_location	!samegp
+#else
 	jsr	ra, __errno_location
+#endif
 
 	/* Store the error value.  */
 	ldq	t0, 8(sp)
@@ -49,16 +84,15 @@ __syscall_error:
 	ldq	ra, 0(sp)
 	lda	sp, 16(sp)
 	ret
-	.end __syscall_error
-#else
 
-ENTRY(__syscall_error)
-	ldgp	gp, 0(t12)
-	.prologue 1
+#else
 
+	LOADGP
+	PROLOGUE
 	stl	v0, errno
 	lda	v0, -1
 	ret
-	END(__syscall_error)
 
-#endif /* _LIBC_REENTRANT */
+#endif
+
+	.end __syscall_error