summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-03-06 07:30:01 +0000
committerJakub Jelinek <jakub@redhat.com>2006-03-06 07:30:01 +0000
commitb3643a38588a0d7217ef933735b9cf142ccdbf2d (patch)
treedfd2d46a4adfdb376f8a8632289e117055f0e039 /sysdeps
parent51d2f6dd7f5c5a2838e864f7d5795f3110536b6d (diff)
Updated to fedora-glibc-20060306T0720
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/bits/posix_opt.h108
-rw-r--r--sysdeps/mach/hurd/fdopendir.c3
-rw-r--r--sysdeps/mach/hurd/i386/tls.h4
-rw-r--r--sysdeps/mach/hurd/opendir.c28
-rw-r--r--sysdeps/posix/sysconf.c152
-rw-r--r--sysdeps/sparc/sparc32/dl-trampoline.S29
-rw-r--r--sysdeps/sparc/sparc32/elf/start.S4
-rw-r--r--sysdeps/sparc/sparc32/memchr.S21
-rw-r--r--sysdeps/sparc/sparc32/memcpy.S40
-rw-r--r--sysdeps/sparc/sparc32/stpcpy.S14
-rw-r--r--sysdeps/sparc/sparc32/strcat.S78
-rw-r--r--sysdeps/sparc/sparc32/strchr.S33
-rw-r--r--sysdeps/sparc/sparc32/strcmp.S14
-rw-r--r--sysdeps/sparc/sparc32/strcpy.S16
-rw-r--r--sysdeps/sparc/sparc32/strlen.S28
-rw-r--r--sysdeps/sparc/sparc64/dl-trampoline.S47
-rw-r--r--sysdeps/sparc/sparc64/elf/start.S4
-rw-r--r--sysdeps/sparc/sparc64/memcpy.S4
-rw-r--r--sysdeps/sparc/sparc64/sparcv9v/memset.S2
-rw-r--r--sysdeps/unix/alpha/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/configure23
-rw-r--r--sysdeps/unix/sysv/linux/configure.in23
-rw-r--r--sysdeps/unix/sysv/linux/sparc/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/rt-sysdep.c1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/clone.S22
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S26
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/socket.S31
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S16
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h155
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/brk.S8
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/clone.S20
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S16
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/socket.S31
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S17
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h176
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sysdep.S1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sysdep.c1
-rw-r--r--sysdeps/unix/sysv/linux/sysconf.c24
40 files changed, 631 insertions, 605 deletions
diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
index 326bebff7f..6747bc276e 100644
--- a/sysdeps/mach/hurd/bits/posix_opt.h
+++ b/sysdeps/mach/hurd/bits/posix_opt.h
@@ -1,5 +1,5 @@
/* Define POSIX options for GNU/Hurd.
- Copyright (C) 1998,2000,2001,2002 Free Software Foundation, Inc.
+ Copyright (C) 1998,2000,2001,2002,2006 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
@@ -31,13 +31,6 @@
/* Processes have a saved set-user-ID and a saved set-group-ID. */
#define _POSIX_SAVED_IDS 1
-#if 0 /* XXX implement aio_* */
-/* Asynchronous I/O is supported. */
-#define _POSIX_ASYNCHRONOUS_IO 1
-/* Alternative name for Unix98. */
-#define _LFS_ASYNCHRONOUS_IO _POSIX_ASYNCHRONOUS_IO
-#endif
-
/* Synchronizing file data is supported, but msync is missing. */
#undef _POSIX_SYNCHRONIZED_IO
@@ -47,15 +40,15 @@
/* Mapping of files to memory is supported. */
#define _POSIX_MAPPED_FILES 200112L
+/* Locking of all memory could be supported in future. */
+#define _POSIX_MEMLOCK 0
+
/* Locking of ranges of memory is supported. */
#define _POSIX_MEMLOCK_RANGE 200112L
/* Setting of memory protections is supported. */
#define _POSIX_MEMORY_PROTECTION 200112L
-/* POSIX.4 shared memory objects are supported (using regular files). */
-#define _POSIX_SHARED_MEMORY_OBJECTS _POSIX_MAPPED_FILES
-
/* Elements of the `c_cc' member of `struct termios' structure
can be disabled by using the value _POSIX_VDISABLE. */
#define _POSIX_VDISABLE ((unsigned char) -1)
@@ -67,13 +60,106 @@
#undef _POSIX_NO_TRUNC /* Overlong file names get error? */
#undef _POSIX_SYNC_IO /* File supports O_SYNC et al? */
+
+/* We do not have the POSIX threads interface. */
+#define _POSIX_THREADS -1
+
+/* We have the reentrant functions described in POSIX. */
+#define _POSIX_REENTRANT_FUNCTIONS 1
+#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
+
+/* These are all things that won't be supported when _POSIX_THREADS is not. */
+#define _POSIX_THREAD_PRIORITY_SCHEDULING -1
+#define _POSIX_THREAD_ATTR_STACKSIZE -1
+#define _POSIX_THREAD_ATTR_STACKADDR -1
+#define _POSIX_SEMAPHORES -1
+
+/* Real-time signals are not yet supported. */
+#define _POSIX_REALTIME_SIGNALS -1
+
+/* Asynchronous I/O might supported with the existing ABI. */
+#define _POSIX_ASYNCHRONOUS_IO 0
+/* Alternative name for Unix98. */
+#define _LFS_ASYNCHRONOUS_IO _POSIX_ASYNCHRONOUS_IO
+
+/* The LFS support in asynchronous I/O is also available. */
+#define _LFS64_ASYNCHRONOUS_IO _POSIX_ASYNCHRONOUS_IO
+
+/* The rest of the LFS is also available. */
+#define _LFS_LARGEFILE 1
+#define _LFS64_LARGEFILE 1
+#define _LFS64_STDIO 1
+
+/* POSIX.4 shared memory objects are supported (using regular files). */
+#define _POSIX_SHARED_MEMORY_OBJECTS _POSIX_MAPPED_FILES
+
+/* CPU-time clocks support needs to be checked at runtime. */
+#define _POSIX_CPUTIME 0
+
+/* Clock support in threads must be also checked at runtime. */
+#define _POSIX_THREAD_CPUTIME 0
+
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1
+/* Reader/Writer locks are not available. */
+#define _POSIX_READER_WRITER_LOCKS -1
+
/* We have a POSIX shell. */
#define _POSIX_SHELL 1
+/* We cannot support the Timeouts option without _POSIX_THREADS. */
+#define _POSIX_TIMEOUTS -1
+
/* The `spawn' function family is supported. */
#define _POSIX_SPAWN 200112L
+/* We do not have POSIX timers, but could in future without ABI change. */
+#define _POSIX_TIMERS 0
+
+/* The barrier functions are not available. */
+#define _POSIX_BARRIERS -1
+
+/* POSIX message queues could be available in future. */
+#define _POSIX_MESSAGE_PASSING 0
+
+/* Thread process-shared synchronization is not supported. */
+#define _POSIX_THREAD_PROCESS_SHARED -1
+
+/* The monotonic clock might be available. */
+#define _POSIX_MONOTONIC_CLOCK 0
+
+/* The clock selection interfaces are available. */
+#define _POSIX_CLOCK_SELECTION 200112L
+
+/* Advisory information interfaces could be available in future. */
+#define _POSIX_ADVISORY_INFO 0
+
+/* IPv6 support is available. */
+#define _POSIX_IPV6 200112L
+
+/* Raw socket support is available. */
+#define _POSIX_RAW_SOCKETS 200112L
+
+/* We have at least one terminal. */
+#define _POSIX2_CHAR_TERM 200112L
+
+/* Neither process nor thread sporadic server interfaces is available. */
+#define _POSIX_SPORADIC_SERVER -1
+#define _POSIX_THREAD_SPORADIC_SERVER -1
+
+/* trace.h is not available. */
+#define _POSIX_TRACE -1
+#define _POSIX_TRACE_EVENT_FILTER -1
+#define _POSIX_TRACE_INHERIT -1
+#define _POSIX_TRACE_LOG -1
+
+/* Typed memory objects are not available. */
+#define _POSIX_TYPED_MEMORY_OBJECTS -1
+
+/* No support for priority inheritance or protection so far. */
+#define _POSIX_THREAD_PRIO_INHERIT -1
+#define _POSIX_THREAD_PRIO_PROTECT -1
+
+
#endif /* bits/posix_opt.h */
diff --git a/sysdeps/mach/hurd/fdopendir.c b/sysdeps/mach/hurd/fdopendir.c
index c9caac30d7..016f825f1d 100644
--- a/sysdeps/mach/hurd/fdopendir.c
+++ b/sysdeps/mach/hurd/fdopendir.c
@@ -40,7 +40,8 @@ __fdopendir (int fd)
/* Ensure that it's a directory. */
error_t err = HURD_FD_PORT_USE
(d, ({
- file_t dir = __file_name_lookup_under (port, "/", O_NOTRANS, 0);
+ file_t dir = __file_name_lookup_under (port, "/",
+ O_DIRECTORY | O_NOTRANS, 0);;
if (dir != MACH_PORT_NULL)
__mach_port_deallocate (__mach_task_self (), dir);
dir != MACH_PORT_NULL ? 0 : errno;
diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
index ff849716e0..223a47d2f2 100644
--- a/sysdeps/mach/hurd/i386/tls.h
+++ b/sysdeps/mach/hurd/i386/tls.h
@@ -98,7 +98,7 @@ _hurd_tls_init (tcbhead_t *tcb, int secondcall)
{
/* Fetch the selector set by the first call. */
int sel;
- asm ("mov %%gs, %w0" : "=q" (sel));
+ asm ("mov %%gs, %w0" : "=q" (sel) : "0" (0));
if (__builtin_expect (sel, 0x50) & 4) /* LDT selector */
{
error_t err = __i386_set_ldt (tcb->self, sel, &desc, 1);
@@ -151,7 +151,7 @@ _hurd_tls_fork (thread_t child, struct i386_thread_state *state)
{
/* Fetch the selector set by _hurd_tls_init. */
int sel;
- asm ("mov %%gs, %w0" : "=q" (sel));
+ asm ("mov %%gs, %w0" : "=q" (sel) : "0" (0));
if (sel == state->ds) /* _hurd_tls_init was never called. */
return 0;
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index 5b10142d39..23e04ede0e 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,94,95,96,97,98,2001,2003,2005
+/* Copyright (C) 1993,1994,1995,1996,1997,1998,2001,2003,2005,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -71,9 +71,6 @@ _hurd_fd_opendir (struct hurd_fd *d)
DIR *
__opendir (const char *name)
{
- int fd;
- DIR *dirp;
-
if (name[0] == '\0')
{
/* POSIX.1-1990 says an empty name gets ENOENT;
@@ -82,31 +79,12 @@ __opendir (const char *name)
return NULL;
}
- {
- /* Append trailing slash to directory name to force ENOTDIR
- if it's not a directory.
-
- We open using the O_NONBLOCK flag so that a nondirectory with
- blocking behavior (FIFO or device) gets ENOTDIR immediately
- rather than waiting for the special file's open wakeup predicate. */
-
- size_t len = strlen (name);
- if (name[len - 1] == '/')
- fd = __open (name, O_RDONLY | O_NONBLOCK);
- else
- {
- char n[len + 2];
- memcpy (n, name, len);
- n[len] = '/';
- n[len + 1] = '\0';
- fd = __open (n, O_RDONLY | O_NONBLOCK);
- }
- }
+ int fd = __open (name, O_RDONLY | O_NONBLOCK | O_DIRECTORY);
if (fd < 0)
return NULL;
/* Extract the pointer to the descriptor structure. */
- dirp = _hurd_fd_opendir (_hurd_fd_get (fd));
+ DIR *dirp = _hurd_fd_opendir (_hurd_fd_get (fd));
if (dirp == NULL)
__close (fd);
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index cb5137cd76..0c0d7d1418 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -95,112 +95,112 @@ __sysconf (name)
return MAX (__tzname_max (), _POSIX_TZNAME_MAX);
case _SC_JOB_CONTROL:
-#ifdef _POSIX_JOB_CONTROL
- return 1;
+#if _POSIX_JOB_CONTROL > 0
+ return _POSIX_JOB_CONTROL;
#else
return -1;
#endif
case _SC_SAVED_IDS:
-#ifdef _POSIX_SAVED_IDS
+#if _POSIX_SAVED_IDS > 0
return 1;
#else
return -1;
#endif
case _SC_REALTIME_SIGNALS:
-#ifdef _POSIX_REALTIME_SIGNALS
+#if _POSIX_REALTIME_SIGNALS > 0
return _POSIX_REALTIME_SIGNALS;
#else
return -1;
#endif
case _SC_PRIORITY_SCHEDULING:
-#ifdef _POSIX_PRIORITY_SCHEDULING
+#if _POSIX_PRIORITY_SCHEDULING > 0
return _POSIX_PRIORITY_SCHEDULING;
#else
return -1;
#endif
case _SC_TIMERS:
-#ifdef _POSIX_TIMERS
+#if _POSIX_TIMERS > 0
return _POSIX_TIMERS;
#else
return -1;
#endif
case _SC_ASYNCHRONOUS_IO:
-#ifdef _POSIX_ASYNCHRONOUS_IO
+#if _POSIX_ASYNCHRONOUS_IO > 0
return _POSIX_ASYNCHRONOUS_IO;
#else
return -1;
#endif
case _SC_PRIORITIZED_IO:
-#ifdef _POSIX_PRIORITIZED_IO
+#if _POSIX_PRIORITIZED_IO > 0
return _POSIX_PRIORITIZED_IO;
#else
return -1;
#endif
case _SC_SYNCHRONIZED_IO:
-#ifdef _POSIX_SYNCHRONIZED_IO
+#if _POSIX_SYNCHRONIZED_IO > 0
return _POSIX_SYNCHRONIZED_IO;
#else
return -1;
#endif
case _SC_FSYNC:
-#ifdef _POSIX_FSYNC
+#if _POSIX_FSYNC > 0
return _POSIX_FSYNC;
#else
return -1;
#endif
case _SC_MAPPED_FILES:
-#ifdef _POSIX_MAPPED_FILES
+#if _POSIX_MAPPED_FILES > 0
return _POSIX_MAPPED_FILES;
#else
return -1;
#endif
case _SC_MEMLOCK:
-#ifdef _POSIX_MEMLOCK
+#if _POSIX_MEMLOCK > 0
return _POSIX_MEMLOCK;
#else
return -1;
#endif
case _SC_MEMLOCK_RANGE:
-#ifdef _POSIX_MEMLOCK_RANGE
+#if _POSIX_MEMLOCK_RANGE > 0
return _POSIX_MEMLOCK_RANGE;
#else
return -1;
#endif
case _SC_MEMORY_PROTECTION:
-#ifdef _POSIX_MEMORY_PROTECTION
+#if _POSIX_MEMORY_PROTECTION > 0
return _POSIX_MEMORY_PROTECTION;
#else
return -1;
#endif
case _SC_MESSAGE_PASSING:
-#ifdef _POSIX_MESSAGE_PASSING
+#if _POSIX_MESSAGE_PASSING > 0
return _POSIX_MESSAGE_PASSING;
#else
return -1;
#endif
case _SC_SEMAPHORES:
-#ifdef _POSIX_SEMAPHORES
+#if _POSIX_SEMAPHORES > 0
return _POSIX_SEMAPHORES;
#else
return -1;
#endif
case _SC_SHARED_MEMORY_OBJECTS:
-#ifdef _POSIX_SHARED_MEMORY_OBJECTS
+#if _POSIX_SHARED_MEMORY_OBJECTS > 0
return _POSIX_SHARED_MEMORY_OBJECTS;
#else
return -1;
@@ -353,49 +353,49 @@ __sysconf (name)
#endif
case _SC_PII:
-#ifdef _POSIX_PII
+#if _POSIX_PII > 0
return 1;
#else
return -1;
#endif
case _SC_PII_XTI:
-#ifdef _POSIX_PII_XTI
+#if _POSIX_PII_XTI > 0
return 1;
#else
return -1;
#endif
case _SC_PII_SOCKET:
-#ifdef _POSIX_PII_SOCKET
+#if _POSIX_PII_SOCKET > 0
return 1;
#else
return -1;
#endif
case _SC_PII_INTERNET:
-#ifdef _POSIX_PII_INTERNET
+#if _POSIX_PII_INTERNET > 0
return 1;
#else
return -1;
#endif
case _SC_PII_OSI:
-#ifdef _POSIX_PII_OSI
+#if _POSIX_PII_OSI > 0
return 1;
#else
return -1;
#endif
case _SC_POLL:
-#ifdef _POSIX_POLL
+#if _POSIX_POLL > 0
return 1;
#else
return -1;
#endif
case _SC_SELECT:
-#ifdef _POSIX_SELECT
+#if _POSIX_SELECT > 0
return 1;
#else
return -1;
@@ -410,35 +410,35 @@ __sysconf (name)
#endif
case _SC_PII_INTERNET_STREAM:
-#ifdef _POSIX_PII_INTERNET_STREAM
+#if _POSIX_PII_INTERNET_STREAM > 0
return 1;
#else
return -1;
#endif
case _SC_PII_INTERNET_DGRAM:
-#ifdef _POSIX_PII_INTERNET_DGRAM
+#if _POSIX_PII_INTERNET_DGRAM > 0
return 1;
#else
return -1;
#endif
case _SC_PII_OSI_COTS:
-#ifdef _POSIX_PII_OSI_COTS
+#if _POSIX_PII_OSI_COTS > 0
return 1;
#else
return -1;
#endif
case _SC_PII_OSI_CLTS:
-#ifdef _POSIX_PII_OSI_CLTS
+#if _POSIX_PII_OSI_CLTS > 0
return 1;
#else
return -1;
#endif
case _SC_PII_OSI_M:
-#ifdef _POSIX_PII_OSI_M
+#if _POSIX_PII_OSI_M > 0
return 1;
#else
return -1;
@@ -519,14 +519,14 @@ __sysconf (name)
/* POSIX 1003.1c (POSIX Threads). */
case _SC_THREADS:
-#ifdef _POSIX_THREADS
+#if _POSIX_THREADS > 0
return _POSIX_THREADS;
#else
return -1;
#endif
case _SC_THREAD_SAFE_FUNCTIONS:
-#ifdef _POSIX_THREAD_SAFE_FUNCTIONS
+#if _POSIX_THREAD_SAFE_FUNCTIONS > 0
return _POSIX_THREAD_SAFE_FUNCTIONS;
#else
return -1;
@@ -553,7 +553,7 @@ __sysconf (name)
#endif
case _SC_THREAD_DESTRUCTOR_ITERATIONS:
-#ifdef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+#if _POSIX_THREAD_DESTRUCTOR_ITERATIONS > 0
return _POSIX_THREAD_DESTRUCTOR_ITERATIONS;
#else
return -1;
@@ -581,42 +581,42 @@ __sysconf (name)
#endif
case _SC_THREAD_ATTR_STACKADDR:
-#ifdef _POSIX_THREAD_ATTR_STACKADDR
+#if _POSIX_THREAD_ATTR_STACKADDR > 0
return _POSIX_THREAD_ATTR_STACKADDR;
#else
return -1;
#endif
case _SC_THREAD_ATTR_STACKSIZE:
-#ifdef _POSIX_THREAD_ATTR_STACKSIZE
+#if _POSIX_THREAD_ATTR_STACKSIZE > 0
return _POSIX_THREAD_ATTR_STACKSIZE;
#else
return -1;
#endif
case _SC_THREAD_PRIORITY_SCHEDULING:
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
return _POSIX_THREAD_PRIORITY_SCHEDULING;
#else
return -1;
#endif
case _SC_THREAD_PRIO_INHERIT:
-#ifdef _POSIX_THREAD_PRIO_INHERIT
+#if _POSIX_THREAD_PRIO_INHERIT > 0
return _POSIX_THREAD_PRIO_INHERIT;
#else
return -1;
#endif
case _SC_THREAD_PRIO_PROTECT:
-#ifdef _POSIX_THREAD_PRIO_PROTECT
+#if _POSIX_THREAD_PRIO_PROTECT > 0
return _POSIX_THREAD_PRIO_PROTECT;
#else
return -1;
#endif
case _SC_THREAD_PROCESS_SHARED:
-#ifdef _POSIX_THREAD_PROCESS_SHARED
+#if _POSIX_THREAD_PROCESS_SHARED > 0
return _POSIX_THREAD_PROCESS_SHARED;
#else
return -1;
@@ -857,40 +857,40 @@ __sysconf (name)
#endif
case _SC_ADVISORY_INFO:
-#ifdef _POSIX_ADVISORY_INFO
+#if _POSIX_ADVISORY_INFO > 0
return _POSIX_ADVISORY_INFO;
#else
return -1;
#endif
case _SC_BARRIERS:
-#ifdef _POSIX_BARRIERS
+#if _POSIX_BARRIERS > 0
return _POSIX_BARRIERS;
#else
return -1;
#endif
case _SC_BASE:
-#ifdef _POSIX_BASE
+#if _POSIX_BASE > 0
return _POSIX_BASE;
#else
return -1;
#endif
case _SC_C_LANG_SUPPORT:
-#ifdef _POSIX_C_LANG_SUPPORT
+#if _POSIX_C_LANG_SUPPORT > 0
return _POSIX_C_LANG_SUPPORT;
#else
return -1;
#endif
case _SC_C_LANG_SUPPORT_R:
-#ifdef _POSIX_C_LANG_SUPPORT_R
+#if _POSIX_C_LANG_SUPPORT_R > 0
return _POSIX_C_LANG_SUPPORT_R;
#else
return -1;
#endif
case _SC_CLOCK_SELECTION:
-#ifdef _POSIX_CLOCK_SELECTION
+#if _POSIX_CLOCK_SELECTION > 0
return _POSIX_CLOCK_SELECTION;
#else
return -1;
@@ -904,58 +904,58 @@ __sysconf (name)
#endif
case _SC_DEVICE_IO:
-#ifdef _POSIX_DEVICE_IO
+#if _POSIX_DEVICE_IO > 0
return _POSIX_DEVICE_IO;
#else
return -1;
#endif
case _SC_DEVICE_SPECIFIC:
-#ifdef _POSIX_DEVICE_SPCIFIC
+#if _POSIX_DEVICE_SPCIFIC > 0
return _POSIX_DEVICE_SPECIFIC;
#else
return -1;
#endif
case _SC_DEVICE_SPECIFIC_R:
-#ifdef _POSIX_DEVICE_SPCIFIC_R
+#if _POSIX_DEVICE_SPCIFIC_R > 0
return _POSIX_DEVICE_SPECIFIC_R;
#else
return -1;
#endif
case _SC_FD_MGMT:
-#ifdef _POSIX_FD_MGMT
+#if _POSIX_FD_MGMT > 0
return _POSIX_FD_MGMT;
#else
return -1;
#endif
case _SC_FIFO:
-#ifdef _POSIX_FIFO
+#if _POSIX_FIFO > 0
return _POSIX_FIFO;
#else
return -1;
#endif
case _SC_PIPE:
-#ifdef _POSIX_PIPE
+#if _POSIX_PIPE > 0
return _POSIX_PIPE;
#else
return -1;
#endif
case _SC_FILE_ATTRIBUTES:
-#ifdef _POSIX_FILE_ATTRIBUTES
+#if _POSIX_FILE_ATTRIBUTES > 0
return _POSIX_FILE_ATTRIBUTES;
#else
return -1;
#endif
case _SC_FILE_LOCKING:
-#ifdef _POSIX_FILE_LOCKING
+#if _POSIX_FILE_LOCKING > 0
return _POSIX_FILE_LOCKING;
#else
return -1;
#endif
case _SC_FILE_SYSTEM:
-#ifdef _POSIX_FILE_SYSTEM
+#if _POSIX_FILE_SYSTEM > 0
return _POSIX_FILE_SYSTEM;
#else
return -1;
@@ -969,53 +969,53 @@ __sysconf (name)
#endif
case _SC_MULTI_PROCESS:
-#ifdef _POSIX_MULTI_PROCESS
+#if _POSIX_MULTI_PROCESS > 0
return _POSIX_MULTI_PROCESS;
#else
return -1;
#endif
case _SC_SINGLE_PROCESS:
-#ifdef _POSIX_SINGLE_PROCESS
+#if _POSIX_SINGLE_PROCESS > 0
return _POSIX_SINGLE_PROCESS;
#else
return -1;
#endif
case _SC_NETWORKING:
-#ifdef _POSIX_NETWORKING
+#if _POSIX_NETWORKING > 0
return _POSIX_NETWORKING;
#else
return -1;
#endif
case _SC_READER_WRITER_LOCKS:
-#ifdef _POSIX_READER_WRITER_LOCKS
+#if _POSIX_READER_WRITER_LOCKS > 0
return _POSIX_READER_WRITER_LOCKS;
#else
return -1;
#endif
case _SC_SPIN_LOCKS:
-#ifdef _POSIX_SPIN_LOCKS
+#if _POSIX_SPIN_LOCKS > 0
return _POSIX_SPIN_LOCKS;
#else
return -1;
#endif
case _SC_REGEXP:
-#ifdef _POSIX_REGEXP
+#if _POSIX_REGEXP > 0
return _POSIX_REGEXP;
#else
return -1;
#endif
case _SC_REGEX_VERSION:
-#ifdef _POSIX_REGEX_VERSION
+#if _POSIX_REGEX_VERSION > 0
return _POSIX_REGEX_VERSION;
#else
return -1;
#endif
case _SC_SHELL:
-#ifdef _POSIX_SHELL
+#if _POSIX_SHELL > 0
return _POSIX_SHELL;
#else
return -1;
@@ -1029,33 +1029,33 @@ __sysconf (name)
#endif
case _SC_SPAWN:
-#ifdef _POSIX_SPAWN
+#if _POSIX_SPAWN > 0
return _POSIX_SPAWN;
#else
return -1;
#endif
case _SC_SPORADIC_SERVER:
-#ifdef _POSIX_SPORADIC_SERVER
+#if _POSIX_SPORADIC_SERVER > 0
return _POSIX_SPORADIC_SERVER;
#else
return -1;
#endif
case _SC_THREAD_SPORADIC_SERVER:
-#ifdef _POSIX_THREAD_SPORADIC_SERVER
+#if _POSIX_THREAD_SPORADIC_SERVER > 0
return _POSIX_THREAD_SPORADIC_SERVER;
#else
return -1;
#endif
case _SC_SYSTEM_DATABASE:
-#ifdef _POSIX_SYSTEM_DATABASE
+#if _POSIX_SYSTEM_DATABASE > 0
return _POSIX_SYSTEM_DATABASE;
#else
return -1;
#endif
case _SC_SYSTEM_DATABASE_R:
-#ifdef _POSIX_SYSTEM_DATABASE_R
+#if _POSIX_SYSTEM_DATABASE_R > 0
return _POSIX_SYSTEM_DATABASE_R;
#else
return -1;
@@ -1069,27 +1069,27 @@ __sysconf (name)
#endif
case _SC_TIMEOUTS:
-#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS > 0
return _POSIX_TIMEOUTS;
#else
return -1;
#endif
case _SC_TYPED_MEMORY_OBJECTS:
-#ifdef _POSIX_TYPED_MEMORY_OBJECTS
+#if _POSIX_TYPED_MEMORY_OBJECTS > 0
return _POSIX_TYPED_MEMORY_OBJECTS;
#else
return -1;
#endif
case _SC_USER_GROUPS:
-#ifdef _POSIX_USER_GROUPS
+#if _POSIX_USER_GROUPS > 0
return _POSIX_USER_GROUPS;
#else
return -1;
#endif
case _SC_USER_GROUPS_R:
-#ifdef _POSIX_USER_GROUPS_R
+#if _POSIX_USER_GROUPS_R > 0
return _POSIX_USER_GROUPS_R;
#else
return -1;
@@ -1154,25 +1154,25 @@ __sysconf (name)
#endif
case _SC_TRACE:
-#ifdef _POSIX_TRACE
+#if _POSIX_TRACE > 0
return _POSIX_TRACE;
#else
return -1;
#endif
case _SC_TRACE_EVENT_FILTER:
-#ifdef _POSIX_TRACE_EVENT_FILTER
+#if _POSIX_TRACE_EVENT_FILTER > 0
return _POSIX_TRACE_EVENT_FILTER;
#else
return -1;
#endif
case _SC_TRACE_INHERIT:
-#ifdef _POSIX_TRACE_INHERIT
+#if _POSIX_TRACE_INHERIT > 0
return _POSIX_TRACE_INHERIT;
#else
return -1;
#endif
case _SC_TRACE_LOG:
-#ifdef _POSIX_TRACE_LOG
+#if _POSIX_TRACE_LOG > 0
return _POSIX_TRACE_LOG;
#else
return -1;
@@ -1198,14 +1198,14 @@ __sysconf (name)
return 0;
case _SC_IPV6:
-#ifdef _POSIX_IPV6
+#if _POSIX_IPV6 > 0
return _POSIX_IPV6;
#else
return -1;
#endif
case _SC_RAW_SOCKETS:
-#ifdef _POSIX_RAW_SOCKETS
+#if _POSIX_RAW_SOCKETS > 0
return _POSIX_RAW_SOCKETS;
#else
return -1;
diff --git a/sysdeps/sparc/sparc32/dl-trampoline.S b/sysdeps/sparc/sparc32/dl-trampoline.S
index 4b7853029a..b0f86dda4e 100644
--- a/sysdeps/sparc/sparc32/dl-trampoline.S
+++ b/sysdeps/sparc/sparc32/dl-trampoline.S
@@ -30,13 +30,22 @@
.globl _dl_runtime_resolve
.type _dl_runtime_resolve, @function
_dl_runtime_resolve:
+ cfi_startproc
+
save %sp, -104, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register (%o7, %i7)
+
ld [%g2 + 8], %o0
srl %g1, 10, %o1
call _dl_fixup
sub %o1, 4*12, %o1
jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve, .-_dl_runtime_resolve
/* For the profiling cases we pass in our stack frame
@@ -56,6 +65,8 @@ _dl_runtime_resolve:
.globl _dl_profile_save_regs
.type _dl_profile_save_regs, @function
_dl_profile_save_regs:
+ cfi_startproc
+
std %l0, [%sp + ( 0 * 8)]
std %l2, [%sp + ( 1 * 8)]
std %l4, [%sp + ( 2 * 8)]
@@ -67,6 +78,9 @@ _dl_profile_save_regs:
ld [%sp + (8 * 8)], %l4
retl
st %l4, [%sp + (8 * 8)]
+
+ cfi_endproc
+
.size _dl_profile_save_regs, .-_dl_profile_save_regs
/* If we are going to call pltexit, then we must replicate
@@ -76,6 +90,8 @@ _dl_profile_save_regs:
.globl _dl_profile_invoke
.type _dl_profile_invoke, @function
_dl_profile_invoke:
+ cfi_startproc
+
sub %sp, %l0, %sp
1:
srl %l0, 3, %l7
@@ -112,6 +128,10 @@ _dl_profile_invoke:
jmpl %i7 + 8, %g0
restore
+ cfi_endproc
+
+ .size _dl_profile_invoke, .-_dl_profile_invoke
+
/* %g1: PLT offset loaded by PLT entry
* %g2: callers PC, which is PLT0 + 4, and we store the
* link map at PLT0 + 12, therefore we add 8 to get
@@ -121,11 +141,17 @@ _dl_profile_invoke:
.globl _dl_runtime_profile
.type _dl_runtime_profile, @function
_dl_runtime_profile:
+ cfi_startproc
+
cmp %fp, 0
be,a 1f
mov 104, %g3
sub %fp, %sp, %g3
1: save %sp, -104, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
ld [%g2 + 8], %o0
srl %g1, 10, %o1
mov %i7, %o2
@@ -152,4 +178,7 @@ _dl_runtime_profile:
1: jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_profile, .-_dl_runtime_profile
diff --git a/sysdeps/sparc/sparc32/elf/start.S b/sysdeps/sparc/sparc32/elf/start.S
index 4c7fb5bd23..702dd755e6 100644
--- a/sysdeps/sparc/sparc32/elf/start.S
+++ b/sysdeps/sparc/sparc32/elf/start.S
@@ -48,6 +48,7 @@
.global _start
.type _start,#function
_start:
+ cfi_startproc
#ifdef SHARED
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
@@ -59,6 +60,7 @@ _start:
drop their arguments. */
mov %g0, %fp
sub %sp, 6*4, %sp
+ cfi_adjust_cfa_offset(6*4)
/* Extract the arguments and environment as encoded on the stack. The
argument info starts after one register window (16 words) past the SP. */
@@ -91,6 +93,8 @@ _start:
/* Die very horribly if exit returns. */
unimp
+ cfi_endproc
+
.size _start, .-_start
/* Define a symbol for the first piece of initialized data. */
diff --git a/sysdeps/sparc/sparc32/memchr.S b/sysdeps/sparc/sparc32/memchr.S
index 0ca56ccdd9..fcd98315db 100644
--- a/sysdeps/sparc/sparc32/memchr.S
+++ b/sysdeps/sparc/sparc32/memchr.S
@@ -32,7 +32,15 @@
.text
.align 4
-0: cmp %o2, 0
+ENTRY(__memchr)
+ andcc %o1, 0xff, %o1
+ sll %o1, 8, %g6
+ andcc %o0, 3, %g0
+ or %o1, %g6, %g6
+ sll %g6, 16, %o3
+ be 10f
+ or %o3, %g6, %g2
+ cmp %o2, 0
be 9f
sethi %hi(0x80808080), %o4
ldub [%o0], %g4
@@ -64,16 +72,7 @@
clr %o0
1: retl
sub %o0, 1, %o0
-
-ENTRY(__memchr)
- andcc %o1, 0xff, %o1
- sll %o1, 8, %g6
- andcc %o0, 3, %g0
- or %o1, %g6, %g6
- sll %g6, 16, %o3
- bne 0b
- or %o3, %g6, %g2
- sethi %hi(0x80808080), %o4
+10: sethi %hi(0x80808080), %o4
or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o5
5: and %o2, 3, %g1
diff --git a/sysdeps/sparc/sparc32/memcpy.S b/sysdeps/sparc/sparc32/memcpy.S
index 35bcef4963..6bd55c06a1 100644
--- a/sysdeps/sparc/sparc32/memcpy.S
+++ b/sysdeps/sparc/sparc32/memcpy.S
@@ -146,28 +146,12 @@
.text
.align 4
-70: andcc %o1, 1, %g0
- be 4f
- andcc %o1, 2, %g0
-
- ldub [%o1 - 1], %g2
- sub %o1, 1, %o1
- stb %g2, [%o0 - 1]
- sub %o2, 1, %o2
- be 3f
- sub %o0, 1, %o0
-4: lduh [%o1 - 2], %g2
- sub %o1, 2, %o1
- sth %g2, [%o0 - 2]
- sub %o2, 2, %o2
- b 3f
- sub %o0, 2, %o0
-
ENTRY(bcopy)
mov %o0, %o3
mov %o1, %o0
mov %o3, %o1
END(bcopy)
+
ENTRY(memmove)
cmp %o0, %o1
st %o0, [%sp + 64]
@@ -185,8 +169,26 @@ ENTRY(memmove)
cmp %o2, 15
bleu 91f
andcc %o1, 3, %g0
- bne 70b
-3: andcc %o1, 4, %g0
+ be 3f
+ nop
+
+ andcc %o1, 1, %g0
+ be 4f
+ andcc %o1, 2, %g0
+
+ ldub [%o1 - 1], %g2
+ sub %o1, 1, %o1
+ stb %g2, [%o0 - 1]
+ sub %o2, 1, %o2
+ be 3f
+ sub %o0, 1, %o0
+4: lduh [%o1 - 2], %g2
+ sub %o1, 2, %o1
+ sth %g2, [%o0 - 2]
+ sub %o2, 2, %o2
+ sub %o0, 2, %o0
+
+3: andcc %o1, 4, %g0
be 2f
mov %o2, %g1
diff --git a/sysdeps/sparc/sparc32/stpcpy.S b/sysdeps/sparc/sparc32/stpcpy.S
index e6688a9b21..222bc2a445 100644
--- a/sysdeps/sparc/sparc32/stpcpy.S
+++ b/sysdeps/sparc/sparc32/stpcpy.S
@@ -38,7 +38,13 @@
.text
.align 4
-10: ldub [%o1], %o5
+
+ENTRY(__stpcpy)
+ andcc %o1, 3, %g0
+ be 20f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o1], %o5
stb %o5, [%o0]
cmp %o5, 0
add %o0, 1, %o0
@@ -67,11 +73,7 @@
1: retl
add %o0, -1, %o0
-ENTRY(__stpcpy)
- andcc %o1, 3, %g0
- bne 10b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+20: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4
5: or %o4, %lo(0x01010101), %o2
6: andcc %o0, 3, %g0
diff --git a/sysdeps/sparc/sparc32/strcat.S b/sysdeps/sparc/sparc32/strcat.S
index 3709c8a692..4ce0771908 100644
--- a/sysdeps/sparc/sparc32/strcat.S
+++ b/sysdeps/sparc/sparc32/strcat.S
@@ -38,36 +38,14 @@
.text
.align 4
-10: cmp %o4, 2
- be 1f
- cmp %o4, 3
- ldub [%o1], %o5
- add %o1, 1, %o1
- stb %o5, [%o0]
- be 3f
- cmp %o5, 0
- be 0f
- add %o0, 1, %o0
-1: lduh [%o1], %o5
- add %o1, 2, %o1
- srl %o5, 8, %o4
- cmp %o4, 0
- stb %o4, [%o0]
- bne,a 2f
- stb %o5, [%o0 + 1]
- retl
- mov %g2, %o0
-2: andcc %o5, 0xff, %o5
- bne 4f
- add %o0, 2, %o0
- retl
- mov %g2, %o0
-3: bne 4f
- add %o0, 1, %o0
- retl
- mov %g2, %o0
-11: ldub [%o0], %o5
+ENTRY(strcat)
+ mov %o0, %g2
+ andcc %o0, 3, %g0
+ be 30f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o0], %o5
cmp %o5, 0
be 1f
add %o0, 1, %o0
@@ -93,12 +71,7 @@
b 3f
sub %o0, 1, %o0
-ENTRY(strcat)
- mov %o0, %g2
- andcc %o0, 3, %g0
- bne 11b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+30: or %o4, %lo(0x80808080), %o3
7: sethi %hi(0x01010101), %o4
8: or %o4, %lo(0x01010101), %o2
9: ld [%o0], %o5
@@ -128,8 +101,39 @@ ENTRY(strcat)
ld [%o0], %o5
sub %o0, 1, %o0
3: andcc %o1, 3, %o4
- bne 10b
-4: andcc %o0, 3, %g3
+ be 4f
+ nop
+
+ cmp %o4, 2
+ be 11f
+ cmp %o4, 3
+ ldub [%o1], %o5
+ add %o1, 1, %o1
+ stb %o5, [%o0]
+ be 13f
+ cmp %o5, 0
+ be 0f
+ add %o0, 1, %o0
+11: lduh [%o1], %o5
+ add %o1, 2, %o1
+ srl %o5, 8, %o4
+ cmp %o4, 0
+ stb %o4, [%o0]
+ bne,a 12f
+ stb %o5, [%o0 + 1]
+ retl
+ mov %g2, %o0
+12: andcc %o5, 0xff, %o5
+ bne 4f
+ add %o0, 2, %o0
+ retl
+ mov %g2, %o0
+13: bne 4f
+ add %o0, 1, %o0
+ retl
+ mov %g2, %o0
+
+4: andcc %o0, 3, %g3
bne 12f
1: ld [%o1], %o5
add %o1, 4, %o1
diff --git a/sysdeps/sparc/sparc32/strchr.S b/sysdeps/sparc/sparc32/strchr.S
index 6120ecd6a3..7c397171f5 100644
--- a/sysdeps/sparc/sparc32/strchr.S
+++ b/sysdeps/sparc/sparc32/strchr.S
@@ -39,9 +39,20 @@
.text
.align 4
-10: ldub [%o0], %g4
+ENTRY(strchr)
+ andcc %o1, 0xff, %o1
+ be 12f
+ sll %o1, 8, %o2
+ andcc %o0, 3, %g0
+ or %o1, %o2, %o2
+ sethi %hi(0x80808080), %o4
+ sll %o2, 16, %o3
+ be 13f
+ or %o3, %o2, %g2
+
+ ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
@@ -50,7 +61,7 @@
or %o4, %lo(0x80808080), %o3
ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
@@ -59,27 +70,17 @@
sethi %hi(0x01010101), %o5
ldub [%o0], %g4
cmp %g4, %o1
- be 1f
+ be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
or %o5, %lo(0x01010101), %o2
b 6f
ld [%o0], %g4
-1: retl
+11: retl
sub %o0, 1, %o0
-ENTRY(strchr)
- andcc %o1, 0xff, %o1
- be 12f
- sll %o1, 8, %o2
- andcc %o0, 3, %g0
- or %o1, %o2, %o2
- sethi %hi(0x80808080), %o4
- sll %o2, 16, %o3
- bne 10b
- or %o3, %o2, %g2
- or %o4, %lo(0x80808080), %o3
+13: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o5
5: or %o5, %lo(0x01010101), %o2
7: ld [%o0], %g4
diff --git a/sysdeps/sparc/sparc32/strcmp.S b/sysdeps/sparc/sparc32/strcmp.S
index 6723593eed..cf369dd839 100644
--- a/sysdeps/sparc/sparc32/strcmp.S
+++ b/sysdeps/sparc/sparc32/strcmp.S
@@ -38,7 +38,13 @@
.text
.align 4
-10: ldub [%o0], %o4
+
+ENTRY(strcmp)
+ andcc %o0, 3, %g0
+ be 13f
+ sethi %hi(0x80808080), %g1
+
+ ldub [%o0], %o4
add %o0, 1, %o0
ldub [%o1], %o5
cmp %o4, 0
@@ -76,11 +82,7 @@
2: retl
mov %o4, %o0
-ENTRY(strcmp)
- andcc %o0, 3, %g0
- bne 10b
- sethi %hi(0x80808080), %g1
- or %g1, %lo(0x80808080), %o3
+13: or %g1, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %g1
5: andcc %o1, 3, %g2
bne 12f
diff --git a/sysdeps/sparc/sparc32/strcpy.S b/sysdeps/sparc/sparc32/strcpy.S
index 787ac9f7c8..f3f337e3f7 100644
--- a/sysdeps/sparc/sparc32/strcpy.S
+++ b/sysdeps/sparc/sparc32/strcpy.S
@@ -38,7 +38,14 @@
.text
.align 4
-1: ldub [%o1], %o5
+
+ENTRY(strcpy)
+ mov %o0, %g2
+ andcc %o1, 3, %g0
+ be 10f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o1], %o5
stb %o5, [%o0]
cmp %o5, 0
add %o0, 1, %o0
@@ -65,12 +72,7 @@
b 6f
andcc %o0, 3, %g3
-ENTRY(strcpy)
- mov %o0, %g2
- andcc %o1, 3, %g0
- bne 1b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+10: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4
5: andcc %o0, 3, %g3
6: bne 10f
diff --git a/sysdeps/sparc/sparc32/strlen.S b/sysdeps/sparc/sparc32/strlen.S
index 76466ec9dd..ed92f20e28 100644
--- a/sysdeps/sparc/sparc32/strlen.S
+++ b/sysdeps/sparc/sparc32/strlen.S
@@ -38,39 +38,41 @@
.text
.align 4
-10: ldub [%o0], %o5
+
+ENTRY(strlen)
+ mov %o0, %o1
+ andcc %o0, 3, %g0
+ be 20f
+ sethi %hi(0x80808080), %o4
+
+ ldub [%o0], %o5
cmp %o5, 0
- be 1f
+ be 21f
add %o0, 1, %o0
andcc %o0, 3, %g0
be 4f
or %o4, %lo(0x80808080), %o3
ldub [%o0], %o5
cmp %o5, 0
- be 2f
+ be 22f
add %o0, 1, %o0
andcc %o0, 3, %g0
be 5f
sethi %hi(0x01010101), %o4
ldub [%o0], %o5
cmp %o5, 0
- be 3f
+ be 23f
add %o0, 1, %o0
b 11f
or %o4, %lo(0x01010101), %o2
-1: retl
+21: retl
mov 0, %o0
-2: retl
+22: retl
mov 1, %o0
-3: retl
+23: retl
mov 2, %o0
-ENTRY(strlen)
- mov %o0, %o1
- andcc %o0, 3, %g0
- bne 10b
- sethi %hi(0x80808080), %o4
- or %o4, %lo(0x80808080), %o3
+20: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4
5: or %o4, %lo(0x01010101), %o2
11: ld [%o0], %o5
diff --git a/sysdeps/sparc/sparc64/dl-trampoline.S b/sysdeps/sparc/sparc64/dl-trampoline.S
index f85527f4c4..81e5c556c3 100644
--- a/sysdeps/sparc/sparc64/dl-trampoline.S
+++ b/sysdeps/sparc/sparc64/dl-trampoline.S
@@ -30,7 +30,13 @@
.globl _dl_runtime_resolve_0
.type _dl_runtime_resolve_0, @function
_dl_runtime_resolve_0:
+ cfi_startproc
+
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
sethi %hi(1047552), %l2
ldx [%g4 + 32 + 8], %o0
sub %g1, %g4, %l0
@@ -54,6 +60,9 @@ _dl_runtime_resolve_0:
sllx %l0, 3, %o1
jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve_0, .-_dl_runtime_resolve_0
/* %g1: PLT offset loaded by PLT entry
@@ -64,7 +73,13 @@ _dl_runtime_resolve_0:
.globl _dl_runtime_resolve_1
.type _dl_runtime_resolve_1, @function
_dl_runtime_resolve_1:
+ cfi_startproc
+
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
srlx %g1, 12, %o1
ldx [%g4 + 8], %o0
add %o1, %o1, %o3
@@ -73,6 +88,9 @@ _dl_runtime_resolve_1:
add %o1, %o3, %o1
jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1
/* For the profiling cases we pass in our stack frame
@@ -92,6 +110,8 @@ _dl_runtime_resolve_1:
.globl _dl_profile_save_regs
.type _dl_profile_save_regs, @function
_dl_profile_save_regs:
+ cfi_startproc
+
stx %l0, [%sp + STACK_BIAS + ( 0 * 8)]
stx %l1, [%sp + STACK_BIAS + ( 1 * 8)]
stx %l2, [%sp + STACK_BIAS + ( 2 * 8)]
@@ -125,6 +145,9 @@ _dl_profile_save_regs:
std %f28, [%sp + STACK_BIAS + (30 * 8)]
retl
std %f30, [%sp + STACK_BIAS + (31 * 8)]
+
+ cfi_endproc
+
.size _dl_profile_save_regs, .-_dl_profile_save_regs
/* If we are going to call pltexit, then we must replicate
@@ -134,6 +157,8 @@ _dl_profile_save_regs:
.globl _dl_profile_invoke
.type _dl_profile_invoke, @function
_dl_profile_invoke:
+ cfi_startproc
+
sub %sp, %l0, %sp
1:
srlx %l0, 3, %l7
@@ -180,6 +205,10 @@ _dl_profile_invoke:
jmpl %i7 + 8, %g0
restore
+ cfi_endproc
+
+ .size _dl_profile_invoke, .-_dl_profile_invoke
+
/* %g1: PLT offset loaded by PLT entry
* %g4: callers PC, which is PLT0 + 24, therefore we
* add (32 + 8) to get the address of PLT2 which
@@ -189,10 +218,16 @@ _dl_profile_invoke:
.globl _dl_runtime_profile_0
.type _dl_runtime_profile_0, @function
_dl_runtime_profile_0:
+ cfi_startproc
+
brz,a,pn %fp, 1f
mov 192, %g5
sub %fp, %sp, %g5
1: save %sp, -336, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
sethi %hi(1047552), %l2
ldx [%g4 + 32 + 8], %o0
sub %g1, %g4, %l0
@@ -236,6 +271,9 @@ _dl_runtime_profile_0:
1: jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_profile_0, .-_dl_runtime_profile_0
/* %g1: PLT offset loaded by PLT entry
@@ -246,10 +284,16 @@ _dl_runtime_profile_0:
.globl _dl_runtime_profile_1
.type _dl_runtime_profile_1, @function
_dl_runtime_profile_1:
+ cfi_startproc
+
brz,a,pn %fp, 1f
mov 192, %g5
sub %fp, %sp, %g5
1: save %sp, -336, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
+
srlx %g1, 12, %o1
ldx [%g4 + 8], %o0
add %o1, %o1, %o3
@@ -277,4 +321,7 @@ _dl_runtime_profile_1:
1: jmp %o0
restore
+
+ cfi_endproc
+
.size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1
diff --git a/sysdeps/sparc/sparc64/elf/start.S b/sysdeps/sparc/sparc64/elf/start.S
index c008c6cea0..df44cae068 100644
--- a/sysdeps/sparc/sparc64/elf/start.S
+++ b/sysdeps/sparc/sparc64/elf/start.S
@@ -48,6 +48,7 @@
.global _start
.type _start,#function
_start:
+ cfi_startproc
#ifdef SHARED
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
@@ -59,6 +60,7 @@ _start:
drop their arguments. */
mov %g0, %fp
sub %sp, 6*8, %sp
+ cfi_adjust_cfa_offset(6*8)
/* Extract the arguments and environment as encoded on the stack. The
argument info starts after one register window (16 words) past the SP,
@@ -92,6 +94,8 @@ _start:
/* Die very horribly if exit returns. */
illtrap 0
+ cfi_endproc
+
.size _start, .-_start
/* Define a symbol for the first piece of initialized data. */
diff --git a/sysdeps/sparc/sparc64/memcpy.S b/sysdeps/sparc/sparc64/memcpy.S
index a3f7b96a91..5993358017 100644
--- a/sysdeps/sparc/sparc64/memcpy.S
+++ b/sysdeps/sparc/sparc64/memcpy.S
@@ -209,6 +209,7 @@ ENTRY(bcopy)
END(bcopy)
.align 32
+ENTRY(__memcpy_large)
200: be,pt %xcc, 201f /* CTI */
andcc %o0, 0x38, %g5 /* IEU1 Group */
mov 8, %g1 /* IEU0 */
@@ -443,6 +444,7 @@ END(bcopy)
stb %o5, [%o0 - 1] /* Store */
209: retl
mov %g4, %o0
+END(__memcpy_large)
#ifdef USE_BPR
@@ -698,6 +700,7 @@ ENTRY(memcpy)
END(memcpy)
.align 32
+ENTRY(__memmove_slowpath)
228: andcc %o2, 1, %g0 /* IEU1 Group */
be,pt %icc, 2f+4 /* CTI */
1: ldub [%o1 - 1], %o5 /* LOAD Group */
@@ -718,6 +721,7 @@ END(memcpy)
mov %g4, %o0
219: retl
nop
+END(__memmove_slowpath)
.align 32
ENTRY(memmove)
diff --git a/sysdeps/sparc/sparc64/sparcv9v/memset.S b/sysdeps/sparc/sparc64/sparcv9v/memset.S
index 7a51ef77dc..ac0a50cf8e 100644
--- a/sysdeps/sparc/sparc64/sparcv9v/memset.S
+++ b/sysdeps/sparc/sparc64/sparcv9v/memset.S
@@ -45,6 +45,7 @@ ENTRY(memset)
sllx %o2, 32, %g1
ba,pt %XCC, 1f
or %g1, %o2, %o2
+END(memset)
ENTRY(__bzero)
clr %o2
@@ -121,7 +122,6 @@ ENTRY(__bzero)
retl
mov %o3, %o0
END(__bzero)
-END(memset)
libc_hidden_builtin_def (memset)
weak_alias (__bzero, bzero)
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 2260ec5480..2e5bc798eb 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -415,7 +415,7 @@ __LABEL(name) \
# else
extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
# define PTR_DEMANGLE(var) PTR_MANGLE(var)
# endif
#elif defined PIC
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index 06683089ad..a8a9cc4702 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -115,10 +115,6 @@ case "$machine" in
arch_minimum_kernel=2.0.10
libc_cv_gcc_unwind_find_fde=yes
;;
- mips*)
- arch_minimum_kernel=2.4.0
- libc_cv_gcc_unwind_find_fde=yes
- ;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.0.10
@@ -228,10 +224,12 @@ fi
# in /lib and /etc.
case "$prefix" in
/usr | /usr/)
- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
+ # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
+ # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
+ # and libc_cv_localedir.
+ test -n "$libc_cv_slibdir" || \
case $machine in
- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
- mips/mips64/n64/* )
+ sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
libc_cv_slibdir="/lib64"
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
@@ -239,14 +237,6 @@ case "$prefix" in
libc_cv_localedir='${exec_prefix}/lib/locale'
fi
;;
- mips/mips64/n32/* )
- libc_cv_slibdir="/lib32"
- if test "$libdir" = '${exec_prefix}/lib'; then
- libdir='${exec_prefix}/lib32';
- # Locale data can be shared between 32bit and 64bit libraries
- libc_cv_localedir='${exec_prefix}/lib/locale'
- fi
- ;;
*)
libc_cv_slibdir="/lib"
;;
@@ -317,9 +307,6 @@ case "$machine" in
ia64*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
- mips/*64*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed
- ;;
s390*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index b90de065af..43681f3251 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -75,10 +75,6 @@ case "$machine" in
arch_minimum_kernel=2.0.10
libc_cv_gcc_unwind_find_fde=yes
;;
- mips*)
- arch_minimum_kernel=2.4.0
- libc_cv_gcc_unwind_find_fde=yes
- ;;
powerpc/powerpc32)
libc_cv_gcc_unwind_find_fde=yes
arch_minimum_kernel=2.0.10
@@ -163,10 +159,12 @@ fi
# in /lib and /etc.
case "$prefix" in
/usr | /usr/)
- # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
+ # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
+ # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
+ # and libc_cv_localedir.
+ test -n "$libc_cv_slibdir" || \
case $machine in
- sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
- mips/mips64/n64/* )
+ sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
libc_cv_slibdir="/lib64"
if test "$libdir" = '${exec_prefix}/lib'; then
libdir='${exec_prefix}/lib64';
@@ -174,14 +172,6 @@ case "$prefix" in
libc_cv_localedir='${exec_prefix}/lib/locale'
fi
;;
- mips/mips64/n32/* )
- libc_cv_slibdir="/lib32"
- if test "$libdir" = '${exec_prefix}/lib'; then
- libdir='${exec_prefix}/lib32';
- # Locale data can be shared between 32bit and 64bit libraries
- libc_cv_localedir='${exec_prefix}/lib/locale'
- fi
- ;;
*)
libc_cv_slibdir="/lib"
;;
@@ -252,9 +242,6 @@ case "$machine" in
ia64*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
- mips/*64*)
- ldd_rewrite_script=../sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed
- ;;
s390*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/Makefile
index 29e5406348..9cb2a634d5 100644
--- a/sysdeps/unix/sysv/linux/sparc/Makefile
+++ b/sysdeps/unix/sysv/linux/sparc/Makefile
@@ -1 +1,5 @@
64bit-predefine = __sparc_v9__ __arch64__
+
+ifeq ($(subdir),rt)
+librt-routines += rt-sysdep
+endif
diff --git a/sysdeps/unix/sysv/linux/sparc/rt-sysdep.c b/sysdeps/unix/sysv/linux/sparc/rt-sysdep.c
new file mode 100644
index 0000000000..3ff55952e2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/rt-sysdep.c
@@ -0,0 +1 @@
+#include <sysdep.c>
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
index 95106d149f..f91fc4f629 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
@@ -24,6 +24,7 @@
#include <asm/errno.h>
#include <asm/unistd.h>
#include <tcb-offsets.h>
+#include <sysdep.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
@@ -32,12 +33,11 @@
pid_t *ptid, void *tls, pid_t *ctid); */
.text
- .align 4
- .globl __clone
- .type __clone,@function
-
-__clone:
+ENTRY (__clone)
save %sp,-96,%sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
/* sanity check arguments */
orcc %i0,%g0,%g2
@@ -67,21 +67,21 @@ __clone:
tst %o1
bne __thread_start
nop
- ret
+ jmpl %i7 + 8, %g0
restore %o0,%g0,%o0
.Lerror:
call __errno_location
or %g0,EINVAL,%i0
st %i0,[%o0]
- ret
+ jmpl %i7 + 8, %g0
restore %g0,-1,%o0
-
- .size __clone, .-__clone
+END(__clone)
.type __thread_start,@function
-
__thread_start:
+ cfi_startproc
+
#ifdef RESET_PID
sethi %hi(CLONE_THREAD), %l0
andcc %g4, %l0, %g0
@@ -102,6 +102,8 @@ __thread_start:
call _exit,0
nop
+ cfi_endproc
+
.size __thread_start, .-__thread_start
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
index 27ea9f8912..dbe0872616 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
@@ -19,20 +19,22 @@
#include <sysdep.h>
- .globl __libc_pipe
-ENTRY (__libc_pipe)
- mov %o0, %o2 /* Save PIPEDES. */
- mov SYS_ify(pipe),%g1
- ta 0x10
- bcs __syscall_error_handler
- nop
- st %o0, [%o2] /* PIPEDES[0] = %o0; */
- st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
+ .text
+ .globl __syscall_error
+ENTRY(__libc_pipe)
+ mov %o0, %o2 /* Save PIPEDES. */
+ mov SYS_ify(pipe),%g1
+ ta 0x10
+ bcc 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: st %o0, [%o2] /* PIPEDES[0] = %o0; */
+ st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
retl
- clr %o0
- SYSCALL_ERROR_HANDLER
+ clr %o0
+END(__libc_pipe)
-PSEUDO_END (__libc_pipe)
weak_alias (__libc_pipe, __pipe)
libc_hidden_def (__pipe)
weak_alias (__libc_pipe, pipe)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
index 911d5c6b39..71a63d5b79 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
@@ -47,7 +47,7 @@
# endif
#endif
-.globl __socket
+ .globl __syscall_error
ENTRY (__socket)
/* Drop up to 6 arguments (recvfrom) into the memory allocated by
@@ -76,18 +76,19 @@ ENTRY (__socket)
add %sp, 68, %o1 /* arg 2: parameter block */
LOADSYSCALL(socketcall)
t 0x10
- bcs __syscall_error_handler
- nop
- retl
+ bcc 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: jmpl %o7 + 8, %g0
nop
#if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel:
- cfi_startproc
save %sp, -96, %sp
- cfi_def_cfa_register (%fp)
+ cfi_def_cfa_register(%fp)
cfi_window_save
- cfi_register (%o7, %i7)
+ cfi_register(%o7, %i7)
CENABLE
nop
mov %o0, %l0
@@ -95,18 +96,20 @@ ENTRY (__socket)
mov P(SOCKOP_,socket), %o0
LOADSYSCALL(socketcall)
t 0x10
- bcs __syscall_error_handler2
+ bcc 1f
mov %o0, %l1
- CDISABLE
+ CDISABLE;
+ mov %l0, %o0;
+ call __syscall_error;
+ mov %l1, %o0;
+ b 1f
+ mov -1, %l1;
+1: CDISABLE
mov %l0, %o0
- jmpl %i7 + 8, %g0
+2: jmpl %i7 + 8, %g0
restore %g0, %l1, %o0
- cfi_endproc
- SYSCALL_ERROR_HANDLER2
#endif
- SYSCALL_ERROR_HANDLER
-
END (__socket)
#ifndef NO_WEAK_ALIAS
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
index 3b135c8e86..1610745524 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
@@ -17,8 +17,10 @@
02111-1307 USA. */
#include <sysdep.h>
+
.text
-ENTRY (syscall)
+ .globl __syscall_error
+ENTRY(syscall)
mov %o0, %g1
mov %o1, %o0
mov %o2, %o1
@@ -26,10 +28,10 @@ ENTRY (syscall)
mov %o4, %o3
mov %o5, %o4
ta 0x10
- bcs __syscall_error_handler
- nop
- retl
+ bcc 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: retl
nop
- SYSCALL_ERROR_HANDLER
-
-PSEUDO_END (syscall)
+END(syscall)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
index 45f5c44d5d..c808a97fc5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
@@ -38,131 +38,54 @@
#undef PSEUDO
#undef PSEUDO_NOERRNO
#undef PSEUDO_ERRVAL
+#undef PSEUDO_END
#undef ENTRY
#undef END
#undef LOC
-#define ENTRY(name) \
- .global C_SYMBOL_NAME(name); \
- .align 4;\
- C_LABEL(name);\
- .type name,@function;
+#define ENTRY(name) \
+ .align 4; \
+ .global C_SYMBOL_NAME(name); \
+ .type name, @function; \
+C_LABEL(name) \
+ cfi_startproc;
-#define END(name) \
+#define END(name) \
+ cfi_endproc; \
.size name, . - name
#define LOC(name) .L##name
-#ifdef LINKER_HANDLES_R_SPARC_WDISP22
-/* Unfortunately, we cannot do this yet. Linker doesn't seem to
- handle R_SPARC_WDISP22 against non-STB_LOCAL symbols properly . */
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .section .gnu.linkonce.t.handler,"ax",@progbits; \
- .globl handler; \
- .hidden handler; \
- .type handler,@function; \
-handler:
-#else
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .subsection 3; \
-handler:
-#endif
-
-#if RTLD_PRIVATE_ERRNO
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits; \
- .globl __sparc_get_pic_l7; \
- .hidden __sparc_get_pic_l7; \
- .type __sparc_get_pic_l7,@function; \
-__sparc_get_pic_l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp,-96,%sp; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc_get_pic_l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- ld [%l7 + rtld_errno], %l0; \
- st %i0, [%l0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#elif USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# ifdef SHARED
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits; \
- .globl __sparc_get_pic_l7; \
- .hidden __sparc_get_pic_l7; \
- .type __sparc_get_pic_l7,@function; \
-__sparc_get_pic_l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp,-96,%sp; \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %l1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc_get_pic_l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- add %l1, %tie_lo10(SYSCALL_ERROR_ERRNO), %l1; \
- ld [%l7 + %l1], %l1, %tie_ld(SYSCALL_ERROR_ERRNO); \
- st %i0, [%g7 + %l1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-# else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_), %g2; \
- add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
- add %g2, %lo(_GLOBAL_OFFSET_TABLE_), %g2; \
- ld [%g2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO); \
- st %o0, [%g7 + %g1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %o7+8, %g0; \
- mov -1, %o0; \
- .previous;
-# endif
-#else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- .global __errno_location; \
- .type __errno_location,@function; \
- save %sp, -96, %sp; \
- call __errno_location; \
- nop; \
- st %i0, [%o0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#endif
-
-#define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10; \
- bcs __syscall_error_handler; \
- nop; \
- SYSCALL_ERROR_HANDLER
-
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10
-
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x10
+ /* If the offset to __syscall_error fits into a signed 22-bit
+ * immediate branch offset, the linker will relax the call into
+ * a normal branch.
+ */
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ .globl __syscall_error; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x10; \
+ bcc 1f; \
+ mov %o7, %g1; \
+ call __syscall_error; \
+ mov %g1, %o7; \
+1:
+
+#define PSEUDO_NOERRNO(name, syscall_name, args)\
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x10;
+
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x10;
+
+#define PSEUDO_END(name) \
+ END(name)
#else /* __ASSEMBLER__ */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
index 1fabd11f71..134ce789f7 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
@@ -37,8 +37,11 @@ __curbrk: .skip 8
#endif
.text
-ENTRY(__brk)
+ENTRY (__brk)
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
#ifdef PIC
1: call 2f
sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
@@ -90,7 +93,6 @@ ENTRY(__brk)
sub %g0, 1, %i0
jmpl %i7+8, %g0
restore
-
- .size __brk, .-__brk
+END (__brk)
weak_alias (__brk, brk)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
index 0e1025ff6a..ebfce9e2c5 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
@@ -23,6 +23,7 @@
#include <asm/errno.h>
#include <asm/unistd.h>
#include <tcb-offsets.h>
+#include <sysdep.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
@@ -34,12 +35,12 @@
.register %g3,#scratch
.text
- .align 4
- .globl __clone
- .type __clone,@function
-__clone:
+ENTRY (__clone)
save %sp, -192, %sp
+ cfi_def_cfa_register(%fp)
+ cfi_window_save
+ cfi_register(%o7, %i7)
/* sanity check arguments */
brz,pn %i0, 99f /* fn non-NULL? */
@@ -65,7 +66,7 @@ __clone:
nop
brnz,pn %o1, __thread_start
nop
- ret
+ jmpl %i7 + 8, %g0
restore %o0, %g0, %o0
99:
#ifndef _LIBC_REENTRANT
@@ -88,12 +89,13 @@ __clone:
nop
st %i0, [%o0]
#endif
- ret
+ jmpl %i7 + 8, %g0
restore %g0,-1,%o0
- .size __clone, .-__clone
+END(__clone)
.type __thread_start,@function
__thread_start:
+ cfi_startproc
#ifdef RESET_PID
sethi %hi(CLONE_THREAD), %l0
andcc %g4, %l0, %g0
@@ -112,6 +114,8 @@ __thread_start:
mov %g3,%o0
call _exit,0
nop
- .size __thread_start, .-__thread_start
+ cfi_endproc
+
+ .size __thread_start, .-__thread_start
weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
index 5ccedff21a..14f244e628 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
@@ -19,18 +19,22 @@
#include <sysdep.h>
-ENTRY (__libc_pipe)
+ .text
+
+ .globl __syscall_error
+ENTRY(__libc_pipe)
mov %o0, %o2 /* Save PIPEDES. */
LOADSYSCALL(pipe)
ta 0x6d
- bcs,pn %xcc, __syscall_error_handler
- nop
- st %o0, [%o2] /* PIPEDES[0] = %o0; */
+ bcc,pt %xcc, 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: st %o0, [%o2] /* PIPEDES[0] = %o0; */
st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
retl
clr %o0
- SYSCALL_ERROR_HANDLER
-PSEUDO_END (__libc_pipe)
+END(__libc_pipe)
weak_alias (__libc_pipe, __pipe)
libc_hidden_def (__pipe)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
index 4e0bc96d22..90d47c18fa 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
@@ -24,12 +24,15 @@
.weak setcontext
ENTRY(setcontext)
- mov 1, %o1
+ ba,pt %xcc, 1f
+ mov 1, %o1
+
+END(setcontext)
/* int __setcontext(ucontext_t *ctx, int restoremask); */
ENTRY(__setcontext)
- ldx [%o0 + UC_SIGMASK], %o2
+1: ldx [%o0 + UC_SIGMASK], %o2
stx %o2, [%o0 + __UC_SIGMASK]
ta 0x6f
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
index 1a9359af5b..ab1690bb42 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
@@ -39,7 +39,8 @@ libc_hidden_def (_setjmp)
/* int setjmp(jmp_buf) */
ENTRY(setjmp)
- set 1, %o1
+ ba,pt %xcc, __sigsetjmp_local
+ set 1, %o1
END(setjmp)
/* int __sigsetjmp(jmp_buf, savemask) */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S
index 7a8b205538..353705b4ac 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/socket.S
@@ -47,8 +47,8 @@
# endif
#endif
-.globl __socket
-ENTRY (__socket)
+ .globl __syscall_error
+ENTRY(__socket)
/* Drop up to 6 arguments (recvfrom) into the memory allocated by
the caller for varargs, since that's really what we have. */
@@ -77,14 +77,15 @@ ENTRY (__socket)
LOADSYSCALL(socketcall)
ta 0x6d
- bcs,pn %xcc, __syscall_error_handler
- nop
- retl
+ bcc,pt %xcc, 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: retl
nop
#if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel:
- cfi_startproc
save %sp, -160, %sp
cfi_def_cfa_register (%fp)
cfi_window_save
@@ -97,19 +98,21 @@ ENTRY (__socket)
LOADSYSCALL(socketcall)
ta 0x6d
- bcs,pn %xcc, __syscall_error_handler2
+ bcc,pt %xcc, 1f
mov %o0, %l1
- CDISABLE
+ CDISABLE;
+ mov %l0, %o0;
+ call __syscall_error;
+ mov %l1, %o0;
+ ba,pt %xcc, 2f
+ mov -1, %l1;
+1: CDISABLE
mov %l0, %o0
- jmpl %i7 + 8, %g0
+2: jmpl %i7 + 8, %g0
restore %g0, %l1, %o0
- cfi_endproc
- SYSCALL_ERROR_HANDLER2
#endif
- SYSCALL_ERROR_HANDLER
-
-END (__socket)
+END(__socket)
#ifndef NO_WEAK_ALIAS
weak_alias (__socket, socket)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
index 27bd086206..27487d8ed9 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
@@ -19,8 +19,8 @@
#include <sysdep.h>
.text
-ENTRY (syscall)
-
+ .globl __syscall_error
+ENTRY(syscall)
mov %o0,%g1
mov %o1,%o0
mov %o2,%o1
@@ -30,11 +30,10 @@ ENTRY (syscall)
ta 0x6d
- bcs,pn %xcc,__syscall_error_handler
- nop
- retl
+ bcc,pt %xcc, 1f
+ mov %o7, %g1
+ call __syscall_error
+ mov %g1, %o7
+1: retl
nop
-
- SYSCALL_ERROR_HANDLER
-
-PSEUDO_END (syscall)
+END(syscall)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
index dfc38f151a..f156f9241a 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
@@ -49,142 +49,52 @@
#undef PSEUDO
#undef PSEUDO_NOERRNO
#undef PSEUDO_ERRVAL
-#undef ENTRY
-
-#define ENTRY(name) \
- .global C_SYMBOL_NAME(name); \
- .align 2; \
- C_LABEL(name); \
- .type name,@function;
-
-#ifdef LINKER_HANDLES_R_SPARC_WDISP22
-/* Unfortunately, we cannot do this yet. Linker doesn't seem to
- handle R_SPARC_WDISP22 against non-STB_LOCAL symbols properly . */
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .section .gnu.linkonce.t.handler,"ax",@progbits; \
- .globl handler; \
- .hidden handler; \
- .type handler,@function; \
-handler:
-#else
-# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
- .subsection 3; \
-handler:
-#endif
-
-#if RTLD_PRIVATE_ERRNO
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc64.get_pic.l7,"ax",@progbits; \
- .globl __sparc64.get_pic.l7; \
- .hidden __sparc64.get_pic.l7; \
- .type __sparc64.get_pic.l7,@function; \
-__sparc64.get_pic.l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp, -192, %sp; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc64.get_pic.l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- sethi %hi(rtld_errno), %g1; \
- or %g1, %lo(rtld_errno), %g1; \
- ldx [%l7 + %g1], %l0; \
- st %i0, [%l0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#elif USE___THREAD
-# ifndef NOT_IN_libc
-# define SYSCALL_ERROR_ERRNO __libc_errno
-# else
-# define SYSCALL_ERROR_ERRNO errno
-# endif
-# ifdef SHARED
-# define SYSCALL_ERROR_HANDLER \
- .section .gnu.linkonce.t.__sparc64.get_pic.l7,"ax",@progbits; \
- .globl __sparc64.get_pic.l7; \
- .hidden __sparc64.get_pic.l7; \
- .type __sparc64.get_pic.l7,@function; \
-__sparc64.get_pic.l7: \
- retl; \
- add %o7, %l7, %l7; \
- .previous; \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- save %sp,-192,%sp; \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %l1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
- call __sparc64.get_pic.l7; \
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
- add %l1, %tie_lo10(SYSCALL_ERROR_ERRNO), %l1; \
- ldx [%l7 + %l1], %l1, %tie_ldx(SYSCALL_ERROR_ERRNO); \
- st %i0, [%g7 + %l1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-# else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
- sethi %hi(_GLOBAL_OFFSET_TABLE_), %g4; \
- add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
- add %g4, %lo(_GLOBAL_OFFSET_TABLE_), %g4; \
- ldx [%g4 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO); \
- st %o0, [%g7 + %g1], %tie_add(SYSCALL_ERROR_ERRNO); \
- jmpl %o7+8, %g0; \
- mov -1, %o0; \
- .previous;
-# endif
-#else
-# define SYSCALL_ERROR_HANDLER \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
- .global __errno_location; \
- .type __errno_location,@function; \
- save %sp, -192, %sp; \
- call __errno_location; \
- nop; \
- st %i0, [%o0]; \
- jmpl %i7+8, %g0; \
- restore %g0, -1, %o0; \
- .previous;
-#endif
-
-#define PSEUDO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d; \
- bcs,pn %xcc, __syscall_error_handler; \
- nop; \
- SYSCALL_ERROR_HANDLER
-
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d
-
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
- .text; \
- ENTRY(name); \
- LOADSYSCALL(syscall_name); \
- ta 0x6d
-
#undef PSEUDO_END
-#define PSEUDO_END(name) \
- .size name,.-name
-
-#undef PSEUDO_END_NOERRNO
-#define PSEUDO_END_NOERRNO(name) \
- .size name,.-name
+#undef ENTRY
+#undef END
-#undef PSEUDO_END_ERRVAL
-#define PSEUDO_END_ERRVAL(name) \
- .size name,.-name
+#define ENTRY(name) \
+ .align 4; \
+ .global C_SYMBOL_NAME(name); \
+ .type name, @function; \
+C_LABEL(name) \
+ cfi_startproc;
+
+#define END(name) \
+ cfi_endproc; \
+ .size name, . - name
+
+ /* If the offset to __syscall_error fits into a signed 22-bit
+ * immediate branch offset, the linker will relax the call into
+ * a normal branch.
+ */
+#define PSEUDO(name, syscall_name, args) \
+ .text; \
+ .globl __syscall_error; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x6d; \
+ bcc,pt %xcc, 1f; \
+ mov %o7, %g1; \
+ call __syscall_error; \
+ mov %g1, %o7; \
+1:
+
+#define PSEUDO_NOERRNO(name, syscall_name, args)\
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x6d;
+
+#define PSEUDO_ERRVAL(name, syscall_name, args) \
+ .text; \
+ENTRY(name); \
+ LOADSYSCALL(syscall_name); \
+ ta 0x6d;
+
+#define PSEUDO_END(name) \
+ END(name)
-#undef END
-#define END(name) \
- .size name,.-name
/* Careful here! This "ret" define can interfere; use jmpl if unsure. */
#define ret retl; nop
diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.S b/sysdeps/unix/sysv/linux/sparc/sysdep.S
deleted file mode 100644
index b031238ceb..0000000000
--- a/sysdeps/unix/sysv/linux/sparc/sysdep.S
+++ /dev/null
@@ -1 +0,0 @@
-/* Nothing to do here. */
diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.c b/sysdeps/unix/sysv/linux/sparc/sysdep.c
new file mode 100644
index 0000000000..f86414570d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sysdep.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/powerpc/sysdep.c>
diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c
index 3cf6aa70bb..f9f6f1bfa5 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2006 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
@@ -48,6 +48,28 @@ __sysconf (int name)
}
#endif
+#if defined __NR_clock_getres || HP_TIMING_AVAIL
+ case _SC_CPUTIME:
+ case _SC_THREAD_CPUTIME:
+ {
+ /* If we have HP_TIMING, we will fall back on that if the system
+ call does not work, so we support it either way. */
+# if !HP_TIMING_AVAIL
+ /* Check using the clock_getres system call. */
+ struct timespec ts;
+ INTERNAL_SYSCALL_DECL (err);
+ int r = INTERNAL_SYSCALL (clock_getres, err, 2,
+ (name == _SC_CPUTIME
+ ? CLOCK_PROCESS_CPUTIME_ID
+ : CLOCK_THREAD_CPUTIME_ID),
+ &ts);
+ if (INTERNAL_SYSCALL_ERROR_P (r, err))
+ return -1;
+# endif
+ return _POSIX_VERSION;
+ }
+#endif
+
case _SC_NGROUPS_MAX:
/* Try to read the information from the /proc/sys/kernel/ngroups_max
file. */