aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-27 21:03:22 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-27 21:03:22 +0000
commit62f29da7cbc527e8f8dda4f5101e6ac504c98505 (patch)
treed1f7d7ed70c131129214bc71441b1d8bbfc7268f /sysdeps/unix
parente4e9446ba3c762d9bddd2718f889af545bf4e95c (diff)
downloadglibc-62f29da7cbc527e8f8dda4f5101e6ac504c98505.tar
glibc-62f29da7cbc527e8f8dda4f5101e6ac504c98505.tar.gz
glibc-62f29da7cbc527e8f8dda4f5101e6ac504c98505.tar.bz2
glibc-62f29da7cbc527e8f8dda4f5101e6ac504c98505.zip
Update.
2003-01-26 Andreas Schwab <schwab@suse.de> * sysdeps/wordsize-32/divdi3.c: Export the functions only as compatibility symbols. Remove INTDEF for __divdi3. * sysdeps/wordsize-32/lldiv.c: Don't use __divdi3_internal. * sysdeps/powerpc/powerpc32/divdi3.c: Remove. * sysdeps/powerpc/powerpc32/Makefile (CPPFLAGS-divdi3.c): Don't define. * sysdeps/powerpc/powerpc32/Dist: Remove divdi3.c. 2003-01-24 Jakub Jelinek <jakub@redhat.com> * elf/tls-macros.h: Add SPARC 32-bit definitions. * sysdeps/sparc/sparc32/elf/configure.in: Add TLS check. * sysdeps/sparc/sparc32/dl-machine.h: Add dl_machine_h guards for the first half of the header. Include tls.h. (elf_machine_type_class): Return ELF_RTYPE_CLASS_PLT for TLS relocs too. (elf_machine_rela): Handle TLS relocs. * sysdeps/sparc/dl-tls.h: New file. * sysdeps/unix/sysv/linux/sparc/sparc32/socket.S: Add cancellation support. * sysdeps/sparc/sparc32/sparcv9/hp-timing.h: Use %g6 instead of %g7. * sysdeps/sparc/sparc32/memchr.S: Likewise. * sysdeps/sparc/sparc32/memcpy.S: Likewise. * sysdeps/sparc/sparc32/strcat.S: Likewise. * sysdeps/sparc/sparc32/strchr.S: Likewise. * sysdeps/sparc/sparc32/strcmp.S: Likewise. * sysdeps/sparc/sparc32/strcpy.S: Likewise. * sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise. * sysdeps/sparc/sparc64/hp-timing.h: Likewise. * sysdeps/sparc/sparc64/memcpy.S: Likewise. * sysdeps/sparc/sparc64/stpcpy.S: Likewise. * sysdeps/sparc/sparc64/stpncpy.S: Likewise. * sysdeps/sparc/sparc64/strcat.S: Likewise. * sysdeps/sparc/sparc64/strchr.S: Likewise. * sysdeps/sparc/sparc64/strcmp.S: Likewise. * sysdeps/sparc/sparc64/strcpy.S: Likewise. * sysdeps/sparc/sparc64/strncmp.S: Likewise. * sysdeps/sparc/sparc64/strncpy.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise. 2003-01-24 Andreas Schwab <schwab@suse.de> * elf/dl-close.c (_dl_close): Don't relocate DT_FINI_ARRAY elements, and process them backwards. * elf/Makefile ($(objpfx)tst-array4): New target. ($(objpfx)tst-array4.out): Likewise. (tests) [$(have-initfini-array) = yes]: Add tst-array4. * elf/tst-array4.c: New file. * elf/tst-array4.exp: Likewise. 2003-01-24 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c: New file. 2003-01-27 Guido Guenther <agx@sigxcpu.org> * sysdeps/unix/sysv/linux/mips/sysdep.h (SYSCALL_ERROR_LABEL): Define. * sysdeps/unix/sysv/linux/mips/pread.c: Add support for cancellation handling and handle both __NR_pread64 and __NR_pread. * sysdeps/unix/sysv/linux/mips/pread64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c: Add support for cancellation handling and handle both __NR_pwrite64 and __NR_pwrite. * sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise. * sysdeps/unix/mips/sysdep.S: Don't set errno in the _LIBC_REENTRANT case, use register names consistently. 2003-01-27 Wolfram Gloger <wg@malloc.de> * malloc/hooks.c (mem2chunk_check): Check alignment of mem pointer, not of the computed chunk. Bug report from Carlos O'Donell <carlos@baldric.uwo.ca>.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/mips/sysdep.S19
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread.c28
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread64.c29
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite.c30
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite64.c28
-rw-r--r--sysdeps/unix/sysv/linux/mips/sysdep.h10
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h4
10 files changed, 188 insertions, 24 deletions
diff --git a/sysdeps/unix/mips/sysdep.S b/sysdeps/unix/mips/sysdep.S
index fa1bfa1722..c710b0c274 100644
--- a/sysdeps/unix/mips/sysdep.S
+++ b/sysdeps/unix/mips/sysdep.S
@@ -27,11 +27,11 @@ ENTRY(__syscall_error)
#ifdef __PIC__
.set noreorder
.set noat
- move $1, $31
- bltzal $0, 0f
+ move AT, ra
+ bltzal zero, 0f
nop
-0: .cpload $31
- move $31, $1
+0: .cpload ra
+ move ra, AT
.set at
.set reorder
#endif
@@ -51,9 +51,6 @@ ENTRY(__syscall_error)
li v0, EAGAIN
skip:
#endif
- /* Store it in the "real" variable ... */
- sw v0, errno
-
/* Find our per-thread errno address */
jal __errno_location
@@ -75,11 +72,11 @@ ENTRY(__syscall_error)
#ifdef __PIC__
.set noreorder
.set noat
- move $1, $31
- bltzal $0, 0f
+ move AT, ra
+ bltzal zero, 0f
nop
-0: .cpload $31
- move $31, $1
+0: .cpload ra
+ move ra, AT
.set at
.set reorder
#endif
diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c
index 45305d2ccc..e6cb21ff93 100644
--- a/sysdeps/unix/sysv/linux/mips/pread.c
+++ b/sysdeps/unix/sysv/linux/mips/pread.c
@@ -22,12 +22,19 @@
#include <unistd.h>
#include <endian.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
#include <kernel-features.h>
+#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
+# ifdef __NR_pread
+# error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
# if __ASSUME_PREAD_SYSCALL == 0
@@ -48,6 +55,22 @@ __libc_pread (fd, buf, count, offset)
{
ssize_t result;
+ if (SINGLE_THREAD_P)
+ {
+ /* First try the syscall. */
+ assert (sizeof (offset) == 4);
+ result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ __LONG_LONG_PAIR (offset >> 31, offset));
+# if __ASSUME_PREAD_SYSCALL == 0
+ if (result == -1 && errno == ENOSYS)
+ /* No system call available. Use the emulation. */
+ result = __emulate_pread (fd, buf, count, offset);
+# endif
+ return result;
+ }
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
/* First try the syscall. */
assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
@@ -57,6 +80,9 @@ __libc_pread (fd, buf, count, offset)
/* No system call available. Use the emulation. */
result = __emulate_pread (fd, buf, count, offset);
# endif
+
+ LIBC_CANCEL_RESET (oldtype);
+
return result;
}
diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c
index d36d68967b..36ec100fb3 100644
--- a/sysdeps/unix/sysv/linux/mips/pread64.c
+++ b/sysdeps/unix/sysv/linux/mips/pread64.c
@@ -21,12 +21,19 @@
#include <unistd.h>
#include <endian.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
#include <kernel-features.h>
+#ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */
+# ifdef __NR_pread
+# error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
# if __ASSUME_PREAD_SYSCALL == 0
@@ -48,6 +55,23 @@ __libc_pread64 (fd, buf, count, offset)
{
ssize_t result;
+
+ if (SINGLE_THREAD_P)
+ {
+ /* First try the syscall. */
+ result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
+ __LONG_LONG_PAIR ((off_t) (offset >> 32),
+ (off_t) (offset & 0xffffffff)));
+# if __ASSUME_PREAD_SYSCALL == 0
+ if (result == -1 && errno == ENOSYS)
+ /* No system call available. Use the emulation. */
+ result = __emulate_pread64 (fd, buf, count, offset);
+# endif
+ return result;
+ }
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
/* First try the syscall. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
@@ -57,6 +81,9 @@ __libc_pread64 (fd, buf, count, offset)
/* No system call available. Use the emulation. */
result = __emulate_pread64 (fd, buf, count, offset);
# endif
+
+ LIBC_CANCEL_RESET (oldtype);
+
return result;
}
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c
index 44f9d30ebf..f25e327877 100644
--- a/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ b/sysdeps/unix/sysv/linux/mips/pwrite.c
@@ -22,12 +22,19 @@
#include <unistd.h>
#include <endian.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
#include <kernel-features.h>
+#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
+# ifdef __NR_pwrite
+# error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
+
#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count,
@@ -47,16 +54,35 @@ __libc_pwrite (fd, buf, count, offset)
{
ssize_t result;
+ if (SINGLE_THREAD_P)
+ {
+ /* First try the syscall. */
+ assert (sizeof (offset) == 4);
+ result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ __LONG_LONG_PAIR (offset >> 31, offset));
+# if __ASSUME_PWRITE_SYSCALL == 0
+ if (result == -1 && errno == ENOSYS)
+ /* No system call available. Use the emulation. */
+ result = __emulate_pwrite (fd, buf, count, offset);
+# endif
+
+ return result;
+ }
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
/* First try the syscall. */
assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
- __LONG_LONG_PAIR (offset >> 31, offset));
+ __LONG_LONG_PAIR (offset >> 31, offset));
# if __ASSUME_PWRITE_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pwrite (fd, buf, count, offset);
# endif
+ LIBC_CANCEL_RESET (oldtype);
+
return result;
}
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c
index 4f7299ed47..0accc1d37b 100644
--- a/sysdeps/unix/sysv/linux/mips/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/mips/pwrite64.c
@@ -21,12 +21,19 @@
#include <unistd.h>
#include <endian.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
#include <kernel-features.h>
+#ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */
+# ifdef __NR_pwrite
+# error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
+
#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count,
@@ -46,6 +53,23 @@ __libc_pwrite64 (fd, buf, count, offset)
{
ssize_t result;
+ if (SINGLE_THREAD_P)
+ {
+ /* First try the syscall. */
+ result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
+ __LONG_LONG_PAIR ((off_t) (offset >> 32),
+ (off_t) (offset & 0xffffffff)));
+# if __ASSUME_PWRITE_SYSCALL == 0
+ if (result == -1 && errno == ENOSYS)
+ /* No system call available. Use the emulation. */
+ result = __emulate_pwrite64 (fd, buf, count, offset);
+# endif
+
+ return result;
+ }
+
+ int oldtype = LIBC_CANCEL_ASYNC ();
+
/* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
@@ -56,6 +80,8 @@ __libc_pwrite64 (fd, buf, count, offset)
result = __emulate_pwrite64 (fd, buf, count, offset);
# endif
+ LIBC_CANCEL_RESET (oldtype);
+
return result;
}
diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h
index 1fd64e5bd5..710479ae18 100644
--- a/sysdeps/unix/sysv/linux/mips/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/sysdep.h
@@ -33,7 +33,15 @@
# define SYS_ify(syscall_name) __NR_/**/syscall_name
#endif
-#ifndef __ASSEMBLER__
+#ifdef __ASSEMBLER__
+
+/* We don't want the label for the error handler to be visible in the symbol
+ table when we define it here. */
+#ifdef __PIC__
+# define SYSCALL_ERROR_LABEL 99b
+#endif
+
+#else /* ! __ASSEMBLER__ */
/* Define a macro which expands into the inline wrapper code for a system
call. */
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
new file mode 100644
index 0000000000..26950aa097
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
@@ -0,0 +1,30 @@
+/* Procedure definition for FE_NOMASK_ENV for Linux/ppc64.
+ Copyright (C) 2003 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <fenv.h>
+#include <errno.h>
+#include <sys/prctl.h>
+
+const fenv_t *
+__fe_nomask_env (void)
+{
+ prctl (PR_SET_FPEXC, PR_FP_EXC_PRECISE);
+
+ return FE_ENABLED_ENV;
+}
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index 7bc734e38a..94b46e1849 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, 1997.
@@ -17,7 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <socketcall.h>
#define P(a, b) P2(a, b)
@@ -63,7 +63,12 @@ ENTRY (__socket)
#endif
#endif
- mov P(SOCKOP_,socket), %o0 /* arg 1: socket subfunction */
+#if defined NEED_CANCELLATION && defined CENABLE
+ SINGLE_THREAD_P
+ cmp %g1, 0
+ bne .Lsocket_cancel
+#endif
+ mov P(SOCKOP_,socket), %o0 /* arg 1: socket subfunction */
add %sp, 68, %o1 /* arg 2: parameter block */
LOADSYSCALL(socketcall)
t 0x10
@@ -72,6 +77,25 @@ ENTRY (__socket)
retl
nop
+#if defined NEED_CANCELLATION && defined CENABLE
+.Lsocket_cancel:
+ save %sp, -96, %sp
+ CENABLE
+ nop
+ mov %o0, %l0
+ add %sp, 68 + 96, %o1
+ mov P(SOCKOP_,socket), %o0
+ LOADSYSCALL(socketcall)
+ t 0x10
+ bcs __syscall_error_handler2
+ mov %o0, %l1
+ CDISABLE
+ mov %l0, %o0
+ jmpl %i7 + 8, %g0
+ restore %g0, %l1, %o0
+ SYSCALL_ERROR_HANDLER2
+#endif
+
SYSCALL_ERROR_HANDLER
END (__socket)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index e362894e17..7bf63b9c54 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
@@ -131,7 +131,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
" sub %%g0, %%o0, %%o0;" \
"1:"
-#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g7", \
+#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index a64da1a223..e2bb8631a3 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
@@ -134,7 +134,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
" sub %%g0, %%o0, %%o0;" \
"1:"
-#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g7", \
+#define __SYSCALL_CLOBBERS "g2", "g3", "g4", "g5", "g6", \
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \