]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20060306T0720
authorJakub Jelinek <jakub@redhat.com>
Mon, 6 Mar 2006 07:30:01 +0000 (07:30 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 6 Mar 2006 07:30:01 +0000 (07:30 +0000)
59 files changed:
ChangeLog
bits/resource.h
fedora/branch.mk
fedora/glibc.spec.in
io/ftw.c
malloc/arena.c
malloc/malloc.c
nptl/ChangeLog
nptl/configure
nptl/sysdeps/unix/sysv/linux/aio_misc.h
nptl/sysdeps/unix/sysv/linux/sparc/Makefile [new file with mode: 0644]
nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S
nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h
nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S
nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S
nptl/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h
nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S
shlib-versions
stdlib/tst-setcontext.c
sysdeps/mach/hurd/bits/posix_opt.h
sysdeps/mach/hurd/fdopendir.c
sysdeps/mach/hurd/i386/tls.h
sysdeps/mach/hurd/opendir.c
sysdeps/posix/sysconf.c
sysdeps/sparc/sparc32/dl-trampoline.S
sysdeps/sparc/sparc32/elf/start.S
sysdeps/sparc/sparc32/memchr.S
sysdeps/sparc/sparc32/memcpy.S
sysdeps/sparc/sparc32/stpcpy.S
sysdeps/sparc/sparc32/strcat.S
sysdeps/sparc/sparc32/strchr.S
sysdeps/sparc/sparc32/strcmp.S
sysdeps/sparc/sparc32/strcpy.S
sysdeps/sparc/sparc32/strlen.S
sysdeps/sparc/sparc64/dl-trampoline.S
sysdeps/sparc/sparc64/elf/start.S
sysdeps/sparc/sparc64/memcpy.S
sysdeps/sparc/sparc64/sparcv9v/memset.S
sysdeps/unix/alpha/sysdep.h
sysdeps/unix/sysv/linux/configure
sysdeps/unix/sysv/linux/configure.in
sysdeps/unix/sysv/linux/sparc/Makefile
sysdeps/unix/sysv/linux/sparc/rt-sysdep.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S
sysdeps/unix/sysv/linux/sparc/sparc32/socket.S
sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S
sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
sysdeps/unix/sysv/linux/sparc/sparc64/brk.S
sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S
sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S
sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S
sysdeps/unix/sysv/linux/sparc/sparc64/socket.S
sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S
sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h
sysdeps/unix/sysv/linux/sparc/sysdep.S [deleted file]
sysdeps/unix/sysv/linux/sparc/sysdep.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sysconf.c

index 9e26c1e3c71164570201e3564e3ac1076366709c..8a9c70e5b869580d839a09748b5c814d7fe17f1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
-2006-03-02  Jakub Jelinek  <jakub@redhat.com>
+2006-03-05  Roland McGrath  <roland@redhat.com>
 
-       * malloc/malloc.c (MALLOC_ALIGNMENT): Set to __alignof__ (long double)
-       if long double is more aligned than 2 * SIZE_SZ.
-       (misaligned_chunk): Define.
-       (public_rEALLOc, _int_free, _int_realloc): Use it.
+       * malloc/malloc.c (MALLOC_ALIGNMENT): Revert to (2 * SIZE_SZ) value.
+       The correct value differs only on powerpc32, and for now changing it
+       there is causing more trouble than it's worth.
+
+       * malloc/arena.c: Add compile-time sanity check on padding calculation.
+
+2006-03-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * malloc/arena.c (heap_info): Adjust the padding size if
+       MALLOC_ALIGNMENT > 2 * SIZE_SZ.
+
+2006-03-05  Roland McGrath  <roland@frob.com>
+
+       * sysdeps/posix/sysconf.c (__sysconf): Use #if _POSIX_FOO > 0
+       rather than #ifdef _POSIX_FOO for options.  We should return -1
+       at runtime for an option defined to 0 at compile time.
+
+       * sysdeps/mach/hurd/bits/posix_opt.h: Define many missing options,
+       many to -1 or 0.
+
+2006-03-05  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/unix/sysv/linux/sysconf.c (__sysconf)
+       [__NR_clock_getres || HP_TIMING_AVAIL]: Handle _SC_CPUTIME,
+       _SC_THREAD_CPUTIME.
+
+2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
+
+       * sysdeps/sparc/sparc32/dl-trampoline.S: Add CFI markings.
+       * sysdeps/sparc/sparc32/elf/start.S: Likewise.
+       * sysdeps/sparc/sparc64/dl-trampoline.S: Likewise.
+       * sysdeps/sparc/sparc64/elf/start.S: Likewise.
+       * sysdeps/sparc/sparc32/memchr.S: Rearrange code to reside
+       within ENTRY/END.
+       * sysdeps/sparc/sparc32/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc32/stpcpy.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/sparc32/strlen.S: Likewise.
+       * sysdeps/sparc/sparc64/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc64/sparcv9v/memset.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Add CFI markings
+       and use __syscall_error.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S: Use __syscall_error.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/socket.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/socket.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Rewrite to use
+       CFI markings and __syscall_error.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/setcontext.S: Rearrange
+       code to reside within ENTRY/END.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sysdep.c: New file.
+       * sysdeps/unix/sysv/linux/sparc/sysdep.S: File removed.
+       * sysdeps/unix/sysv/linux/sparc/rt-sysdep.c: New file.
+       * sysdeps/unix/sysv/linux/sparc/Makefile (librt-routines): Add it.
+
+       * shlib-versions: Use sparc64.*- for CPU patterns.
+
+2006-03-05  Roland McGrath  <roland@frob.com>
+
+       * bits/resource.h (RLIMIT_SBSIZE, RLIMIT_AS, RLIMIT_VMEM): Define.
+
+       * sysdeps/mach/hurd/fdopendir.c (__fdopendir): Use O_DIRECTORY
+       to force directory check.
+       * sysdeps/mach/hurd/opendir.c (__opendir): Likewise.
+
+2006-03-04  Roland McGrath  <roland@frob.com>
+
+       * sysdeps/mach/hurd/i386/tls.h (_hurd_tls_init): Make sure high bits
+       of SEL are clear after copying %gs to low bits.
+       (_hurd_tls_fork): Likewise.
+
+2006-03-03  Roland McGrath  <roland@redhat.com>
+
+       [BZ #2414]
+       * stdlib/tst-setcontext.c (f1): Take arguments of type int.
+
+2006-03-02  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/unix/alpha/sysdep.h (PTR_MANGLE): Use __typeof in cast.
+
+2006-03-02  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/configure.in: Remove MIPS cases.  Allow
+       libc_cv_slibdir et al. to be overridden.
+       * sysdeps/unix/sysv/linux/configure: Regenerated.
+
+2005-12-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/ldconfig.c (search_dir): Skip prelink temporaries.
+
+2006-03-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf/check-textrel.c: Don't include "config.h".
 
 2006-03-02  Jakub Jelinek  <jakub@redhat.com>
 
+       * io/ftw.c (process_entry): If dir->streamfd != -1,
+       use FXSTATAT rather than LXSTAT to find if unstatable
+       file is a dead symlink.
+
        * elf/check-textrel.c: Include config.h.
        (AB(handle_file)): Don't fail if PF_X | PF_W on architectures known
        to have executable writable PLT.
        * sysdeps/powerpc/powerpc32/configure.in (HAVE_PPC_SECURE_PLT): New
        test.
-       * sysdeps/powerpc/powerpc32/configure: Rebuilt.
        * config.h.in (HAVE_PPC_SECURE_PLT): Add.
 
+       * malloc/malloc.c (MALLOC_ALIGNMENT): Set to __alignof__ (long double)
+       if long double is more aligned than 2 * SIZE_SZ.
+       (misaligned_chunk): Define.
+       (public_rEALLOc, _int_free, _int_realloc): Use it.
+
 2006-01-05  H.J. Lu  <hongjiu.lu@intel.com>
 
        [BZ #2013]
index 05b28dfccd8662e022bca4bb6317b6290292a479..8057f5cc657005bdc89fae39fd7d5008c6553a43 100644 (file)
@@ -1,5 +1,5 @@
 /* Bit values & structures for resource limits.  4.4 BSD/generic GNU version.
-   Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1994,1996,1997,1998,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
@@ -63,6 +63,14 @@ enum __rlimit_resource
     RLIMIT_NOFILE = RLIMIT_OFILE, /* Another name for the same thing.  */
 #define        RLIMIT_OFILE    RLIMIT_OFILE
 #define        RLIMIT_NOFILE   RLIMIT_NOFILE
+    /* Maximum size of all socket buffers.  */
+    RLIMIT_SBSIZE,
+#define RLIMIT_SBSIZE  RLIMIT_SBSIZE
+    /* Maximum size in bytes of the process address space.  */
+    RLIMIT_AS,
+    RLIMIT_VMEM = RLIMIT_AS,   /* Another name for the same thing.  */
+#define RLIMIT_AS      RLIMIT_AS
+#define RLIMIT_VMEM    RLIMIT_AS
 
     RLIMIT_NLIMITS,            /* Number of limit flavors.  */
     RLIM_NLIMITS = RLIMIT_NLIMITS /* Traditional name for same.  */
index 1de55dc8611d75e183aa1d8fe1257cf8077b62f1..e124e52298faa00764cad0e3426309068128effc 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-fc4
-fedora-sync-date := 2006-03-02 08:55 UTC
-fedora-sync-tag := fedora-glibc-20060302T0855
+fedora-sync-date := 2006-03-06 07:20 UTC
+fedora-sync-tag := fedora-glibc-20060306T0720
index 843833564f3d300eee638585c90f132d328479ba..b8aa4da33fcdfd9cac318e2ae2f9ba4589413bcc 100644 (file)
@@ -1,4 +1,4 @@
-%define glibcrelease 1
+%define glibcrelease 2
 %define auxarches i586 i686 athlon sparcv9 alphaev6
 %define prelinkarches noarch
 %define xenarches i686 athlon
@@ -1332,6 +1332,13 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Mon Mar  6 2006 Jakub Jelinek <jakub@redhat.com> 2.3.91-2
+- update from CVS
+  - fix sYSMALLOc for MALLOC_ALIGNMENT > 2 * SIZE_SZ (#183895)
+  - revert ppc32 malloc alignment patch, it breaks malloc_set_state
+    and needs some further thoughts and time (#183894)
+- provide accurate unwind info for lowlevellock.h stubs on x86_64
+
 * Thu Mar  2 2006 Jakub Jelinek <jakub@redhat.com> 2.3.91-1
 - update from CVS
   - fixes for various arches
index 50303d9cd09d44cf45a2ddeb61f142206bb51689..e96076a20301097cb2a5e80a15c261151294b425 100644 (file)
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -419,13 +419,22 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
     {
       if (errno != EACCES && errno != ENOENT)
        result = -1;
-      else if (!(data->flags & FTW_PHYS)
-              && (d_type == DT_LNK
-                  || (LXSTAT (_STAT_VER, name, &st) == 0
-                      && S_ISLNK (st.st_mode))))
+      else if (data->flags & FTW_PHYS)
+       flag = FTW_NS;
+      else if (d_type == DT_LNK)
        flag = FTW_SLN;
       else
-       flag = FTW_NS;
+       {
+         if (dir->streamfd != -1)
+           statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st,
+                               AT_SYMLINK_NOFOLLOW);
+         else
+           statres = LXSTAT (_STAT_VER, name, &st);
+         if (statres == 0 && S_ISLNK (st.st_mode))
+           flag = FTW_SLN;
+         else
+           flag = FTW_NS;
+       }
     }
   else
     {
index d0d223e94e42a8972c6acbe17c2c2f28a7499dcf..4d95462f26fae87f15c0db1515b49c05d452ed14 100644 (file)
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
 
@@ -55,9 +55,18 @@ typedef struct _heap_info {
   mstate ar_ptr; /* Arena for this heap. */
   struct _heap_info *prev; /* Previous heap. */
   size_t size;   /* Current size in bytes. */
-  size_t pad;    /* Make sure the following data is properly aligned. */
+  /* Make sure the following data is properly aligned, particularly
+     that sizeof (heap_info) + 2 * SIZE_SZ is a multiple of
+     MALLOG_ALIGNMENT. */
+  char pad[-5 * SIZE_SZ & MALLOC_ALIGN_MASK];
 } heap_info;
 
+/* Get a compile-time error if the heap_info padding is not correct
+   to make alignment work as expected in sYSMALLOc.  */
+extern int sanity_check_heap_info_alignment[(sizeof (heap_info)
+                                            + 2 * SIZE_SZ) % MALLOC_ALIGNMENT
+                                           ? -1 : 1];
+
 /* Thread specific data */
 
 static tsd_key_t arena_key;
index 99b55c8639401a01b6dfcf565b3b74ab47e6e85e..da230d34935b01dc0f8bceb0dc9d2a4b60df8d95 100644 (file)
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>
    and Doug Lea <dl@cs.oswego.edu>, 2001.
@@ -381,8 +381,16 @@ extern "C" {
 
 
 #ifndef MALLOC_ALIGNMENT
+/* XXX This is the correct definition.  It differs from 2*SIZE_SZ only on
+   powerpc32.  For the time being, changing this is causing more
+   compatibility problems due to malloc_get_state/malloc_set_state than
+   will returning blocks not adequately aligned for long double objects
+   under -mlong-double-128.
+
 #define MALLOC_ALIGNMENT       (2 * SIZE_SZ < __alignof__ (long double) \
                                ? __alignof__ (long double) : 2 * SIZE_SZ)
+*/
+#define MALLOC_ALIGNMENT       (2 * SIZE_SZ)
 #endif
 
 /* The corresponding bit mask value */
index b35cfddcace5b879692036bf82e8894c8d819fc1..678a419acacb16f5957782f7a0af388cfedd52a8 100644 (file)
@@ -1,3 +1,23 @@
+2006-03-05  Roland McGrath  <roland@redhat.com>
+
+       * configure (libc_add_on): Disable add-on when $add_ons_automatic = yes
+       and $config_os doesn't match *linux*.
+
+2006-03-05  David S. Miller  <davem@sunset.davemloft.net>
+
+       * sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
+       Use __syscall_error.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/Makefile: New file.
+
+2006-03-02  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.
+
 2006-03-01  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
index 1ce3caec6e69c3a1e2096e69d30aacb26d423a90..dd246c755ad65b0392a24d1484e021f0407ea54c 100644 (file)
@@ -3,3 +3,11 @@
 # as a subdirectory to search for in other add-ons' sysdeps trees.
 
 libc_add_on_canonical=nptl
+
+# Only linux configurations support NPTL.
+if test $add_ons_automatic = yes; then
+  case "$config_os" in
+  *linux*) ;;
+  *) libc_add_on= ;;
+  esac
+fi
index 50064c44c13b9dbcd87c103186f57775eb0468de..406d96e86563e7db2dc690da62c2131a273915d3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
 
 
 #ifndef _AIO_MISC_H
 # include_next <aio_misc.h>
+# include <limits.h>
+# include <pthread.h>
 # include <signal.h>
 # include <sysdep.h>
-# include <pthread.h>
-# include <limits.h>
 
 # define aio_start_notify_thread __aio_start_notify_thread
 # define aio_create_helper_thread __aio_create_helper_thread
@@ -37,7 +37,8 @@ __aio_start_notify_thread (void)
 }
 
 extern inline int
-__aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), void *arg)
+__aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
+                           void *arg)
 {
   pthread_attr_t attr;
 
@@ -64,5 +65,5 @@ __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), void *arg)
 
   (void) pthread_attr_destroy (&attr);
   return ret;
-}                                                                                 
+}
 #endif
diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/Makefile b/nptl/sysdeps/unix/sysv/linux/sparc/Makefile
new file mode 100644 (file)
index 0000000..e98c9bd
--- /dev/null
@@ -0,0 +1,2 @@
+# pull in __syscall_error routine
+libpthread-routines += sysdep
index 55229c9e665c4582c5b7f256ea23816f1a492e34..fb01242b531bfe9275fd7a68a5f935839e9bdbe4 100644 (file)
@@ -21,6 +21,7 @@
 #include <tcb-offsets.h>
 
        .text
+       .globl          __syscall_error
 ENTRY(__vfork)
        ld      [%g7 + PID], %o5
        sub     %g0, %o5, %o4
@@ -28,15 +29,17 @@ ENTRY(__vfork)
 
        LOADSYSCALL(vfork)
        ta      0x10
-       bcs,a   __syscall_error_handler
-        st     %o5, [%g7 + PID]
-       SYSCALL_ERROR_HANDLER
-       sub     %o1, 1, %o1
+       bcc     2f
+        mov    %o7, %g1
+       st      %o5, [%g7 + PID]
+       call    __syscall_error
+        mov    %g1, %o7
+2:     sub     %o1, 1, %o1
        andcc   %o0, %o1, %o0
        bne,a   1f
         st     %o5, [%g7 + PID]
 1:     retl
         nop
+END(__vfork)
 
-PSEUDO_END (__vfork)
 weak_alias (__vfork, vfork)
index 5edf4b3772f11773c612ba93f48745570884adc3..75a4eb94698b2e3ca7877ec10e9005800c0ec9f9 100644 (file)
 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
 
 # undef PSEUDO
-# define PSEUDO(name, syscall_name, args)                                    \
-       .text;                                                                \
-ENTRY(name)                                                                  \
-       ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;                              \
-       cmp %g1, 0;                                                           \
-       bne 1f;                                                               \
-.type  __##syscall_name##_nocancel,@function;                                \
-.globl __##syscall_name##_nocancel;                                          \
-__##syscall_name##_nocancel:                                                 \
-        mov SYS_ify(syscall_name), %g1;                                      \
-       ta 0x10;                                                              \
-       bcs __syscall_error_handler;                                          \
-        nop;                                                                 \
-.size  __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;            \
-       .subsection 2;                                                        \
-       cfi_startproc;                                                        \
-1:     save %sp, -96, %sp;                                                   \
-       cfi_def_cfa_register (%fp);                                           \
-       cfi_window_save;                                                      \
-       cfi_register (%o7, %i7);                                              \
-       CENABLE;                                                              \
-        nop;                                                                 \
-       mov %o0, %l0;                                                         \
-       COPY_ARGS_##args                                                      \
-       mov SYS_ify(syscall_name), %g1;                                       \
-       ta 0x10;                                                              \
-       bcs __syscall_error_handler2;                                         \
-        mov %o0, %l1;                                                        \
-       CDISABLE;                                                             \
-        mov %l0, %o0;                                                        \
-       jmpl %i7 + 8, %g0;                                                    \
-        restore %g0, %l1, %o0;                                               \
-       cfi_endproc;                                                          \
-       .previous;                                                            \
-       SYSCALL_ERROR_HANDLER                                                 \
-       SYSCALL_ERROR_HANDLER2
+# define PSEUDO(name, syscall_name, args)      \
+       .text;                                  \
+       .globl          __syscall_error;        \
+ENTRY(name)                                    \
+       ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
+       cmp %g1, 0;                             \
+       bne 1f;                                 \
+.type  __##syscall_name##_nocancel,@function;  \
+.globl __##syscall_name##_nocancel;            \
+__##syscall_name##_nocancel:                   \
+        mov SYS_ify(syscall_name), %g1;        \
+       ta 0x10;                                \
+       bcc 8f;                                 \
+        mov %o7, %g1;                          \
+       call __syscall_error;                   \
+        mov %g1, %o7;                          \
+8:     jmpl %o7 + 8, %g0;                      \
+        nop;                                   \
+.size  __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
+1:     save %sp, -96, %sp;                     \
+       cfi_def_cfa_register(%fp);              \
+       cfi_window_save;                        \
+       cfi_register(%o7, %i7);                 \
+       CENABLE;                                \
+        nop;                                   \
+       mov %o0, %l0;                           \
+       COPY_ARGS_##args                        \
+       mov SYS_ify(syscall_name), %g1;         \
+       ta 0x10;                                \
+       bcc 1f;                                 \
+        mov %o0, %l1;                          \
+       CDISABLE;                               \
+        mov %l0, %o0;                          \
+       call __syscall_error;                   \
+        mov %l1, %o0;                          \
+       b 2f;                                   \
+        mov -1, %l1;                           \
+1:     CDISABLE;                               \
+        mov %l0, %o0;                          \
+2:     jmpl %i7 + 8, %g0;                      \
+        restore %g0, %l1, %o0;
 
-#define SYSCALL_ERROR_HANDLER2                                               \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2)                        \
-       .global __errno_location;                                             \
-        .type   __errno_location,@function;                                  \
-       CDISABLE;                                                             \
-        mov    %l0, %o0;                                                     \
-       call    __errno_location;                                             \
-        nop;                                                                 \
-       st      %l1, [%o0];                                                   \
-       jmpl    %i7 + 8, %g0;                                                 \
-        restore %g0, -1, %o0;                                                \
-       .previous;
 
 # ifdef IS_IN_libpthread
 #  define CENABLE      call __pthread_enable_asynccancel
index 7229608142c2d48b4ebe45f5a3cfdcadfaf9758c..a8e4dd5a439c4bf4935de9848aad0ec4d8bcf3a1 100644 (file)
@@ -21,6 +21,7 @@
 #include <tcb-offsets.h>
 
        .text
+       .globl          __syscall_error
 ENTRY(__vfork)
        ld      [%g7 + PID], %o5
        cmp     %o5, 0
@@ -31,16 +32,18 @@ ENTRY(__vfork)
 
        LOADSYSCALL(vfork)
        ta      0x10
-       bcs,a   __syscall_error_handler
-        st     %o5, [%g7 + PID]
-       SYSCALL_ERROR_HANDLER
-       sub     %o1, 1, %o1
+       bcc     2f
+        mov    %o7, %g1
+       st      %o5, [%g7 + PID]
+       call    __syscall_error
+        mov    %g1, %o7
+2:     sub     %o1, 1, %o1
        andcc   %o0, %o1, %o0
        bne,a   1f
         st     %o5, [%g7 + PID]
 1:     retl
         nop
+END(__vfork)
 
-PSEUDO_END (__vfork)
 libc_hidden_def (__vfork)
 weak_alias (__vfork, vfork)
index e9018b2e998d3e8d7a112766c5081b713c74c102..8941043c3a056ad4293089b861ba534b16fc0a4c 100644 (file)
@@ -21,6 +21,7 @@
 #include <tcb-offsets.h>
 
        .text
+       .globl  __syscall_error
 ENTRY(__vfork)
        ld      [%g7 + PID], %o5
        sub     %g0, %o5, %o4
@@ -28,15 +29,17 @@ ENTRY(__vfork)
 
        LOADSYSCALL(vfork)
        ta      0x6d
-       bcs,a,pn %xcc, __syscall_error_handler
-        st     %o5, [%g7 + PID]
-       SYSCALL_ERROR_HANDLER
-       sub     %o1, 1, %o1
+       bcc,pt  %xcc, 2f
+        mov    %o7, %g1
+       st      %o5, [%g7 + PID]
+       call    __syscall_error
+        mov    %g1, %o7
+2:     sub     %o1, 1, %o1
        andcc   %o0, %o1, %o0
        bne,a,pt %icc, 1f
         st     %o5, [%g7 + PID]
 1:     retl
         nop
+END(__vfork)
 
-PSEUDO_END (__vfork)
 weak_alias (__vfork, vfork)
index d69623c14544fb592c1f57e2c84d0f63b049f2f5..dd263a597cf9ea5a690c7546359b0c09b1efbbd0 100644 (file)
 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
 
 # undef PSEUDO
-# define PSEUDO(name, syscall_name, args)                                    \
-       .text;                                                                \
-ENTRY(name)                                                                  \
-       ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;                              \
-       brnz,pn %g1, 1f;                                                      \
-.type  __##syscall_name##_nocancel,@function;                                \
-.globl __##syscall_name##_nocancel;                                          \
-__##syscall_name##_nocancel:                                                 \
-        mov SYS_ify(syscall_name), %g1;                                      \
-       ta 0x6d;                                                              \
-       bcs,pn %xcc, __syscall_error_handler;                                 \
-        nop;                                                                 \
-.size  __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;            \
-       .subsection 2;                                                        \
-       cfi_startproc;                                                        \
-1:     save %sp, -192, %sp;                                                  \
-       cfi_def_cfa_register (%fp);                                           \
-       cfi_window_save;                                                      \
-       cfi_register (%o7, %i7);                                              \
-       CENABLE;                                                              \
-        nop;                                                                 \
-       mov %o0, %l0;                                                         \
-       COPY_ARGS_##args                                                      \
-       mov SYS_ify(syscall_name), %g1;                                       \
-       ta 0x6d;                                                              \
-       bcs,pn %xcc, __syscall_error_handler2;                                \
-        mov %o0, %l1;                                                        \
-       CDISABLE;                                                             \
-        mov %l0, %o0;                                                        \
-       jmpl %i7 + 8, %g0;                                                    \
-        restore %g0, %l1, %o0;                                               \
-       cfi_endproc;                                                          \
-       .previous;                                                            \
-       SYSCALL_ERROR_HANDLER                                                 \
-       SYSCALL_ERROR_HANDLER2
-
-#define SYSCALL_ERROR_HANDLER2                                               \
-SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler2)                        \
-       .global __errno_location;                                             \
-        .type   __errno_location,@function;                                  \
-       CDISABLE;                                                             \
-        mov    %l0, %o0;                                                     \
-       call    __errno_location;                                             \
-        nop;                                                                 \
-       st      %l1, [%o0];                                                   \
-       jmpl    %i7 + 8, %g0;                                                 \
-        restore %g0, -1, %o0;                                                \
-       .previous;
+# define PSEUDO(name, syscall_name, args)      \
+       .text;                                  \
+       .globl          __syscall_error;        \
+ENTRY(name)                                    \
+       ld [%g7 + MULTIPLE_THREADS_OFFSET], %g1;\
+       brnz,pn %g1, 1f;                        \
+.type  __##syscall_name##_nocancel,@function;  \
+.globl __##syscall_name##_nocancel;            \
+__##syscall_name##_nocancel:                   \
+        mov SYS_ify(syscall_name), %g1;        \
+       ta 0x6d;                                \
+       bcc,pt %xcc, 8f;                        \
+        mov %o7, %g1;                          \
+       call __syscall_error;                   \
+        mov %g1, %o7;                          \
+8:     jmpl %o7 + 8, %g0;                      \
+        nop;                                   \
+.size  __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;\
+1:     save %sp, -192, %sp;                    \
+       cfi_def_cfa_register(%fp);              \
+       cfi_window_save;                        \
+       cfi_register(%o7, %i7);                 \
+       CENABLE;                                \
+        nop;                                   \
+       mov %o0, %l0;                           \
+       COPY_ARGS_##args                        \
+       mov SYS_ify(syscall_name), %g1;         \
+       ta 0x6d;                                \
+       bcc,pt %xcc, 1f;                        \
+        mov %o0, %l1;                          \
+       CDISABLE;                               \
+        mov %l0, %o0;                          \
+       call __syscall_error;                   \
+        mov %l1, %o0;                          \
+       ba,pt %xcc, 2f;                         \
+        mov -1, %l1;                           \
+1:     CDISABLE;                               \
+        mov %l0, %o0;                          \
+2:     jmpl %i7 + 8, %g0;                      \
+        restore %g0, %l1, %o0;
 
 # ifdef IS_IN_libpthread
 #  define CENABLE      call __pthread_enable_asynccancel
index d6b2455d4393f55036a049a502702b1e2b3979cb..55975743049bed71aea396699b9b6d5699b58bbb 100644 (file)
@@ -21,6 +21,7 @@
 #include <tcb-offsets.h>
 
        .text
+       .globl  __syscall_error
 ENTRY(__vfork)
        ld      [%g7 + PID], %o5
        sethi   %hi(0x80000000), %o3
@@ -31,16 +32,18 @@ ENTRY(__vfork)
 
        LOADSYSCALL(vfork)
        ta      0x6d
-       bcs,a,pn %xcc, __syscall_error_handler
-        st     %o5, [%g7 + PID]
-       SYSCALL_ERROR_HANDLER
-       sub     %o1, 1, %o1
+       bcc,pt  %xcc, 2f
+        mov    %o7, %g1
+       st      %o5, [%g7 + PID]
+       call    __syscall_error
+        mov    %g1, %o7
+2:     sub     %o1, 1, %o1
        andcc   %o0, %o1, %o0
        bne,a,pt %icc, 1f
         st     %o5, [%g7 + PID]
 1:     retl
         nop
+END(__vfork)
 
-PSEUDO_END (__vfork)
 libc_hidden_def (__vfork)
 weak_alias (__vfork, vfork)
index 0e050151161b7f118bf2f77c3eb82e010bd6fc2b..9a10fc056600ce7136543275eb8407f4ec9717f2 100644 (file)
@@ -40,14 +40,14 @@ s390x-.*-.*         WORDSIZE32              s390-@VENDOR@-@OS@
 s390-.*-.*             WORDSIZE64              s390x-@VENDOR@-@OS@
 powerpc64-.*-.*                WORDSIZE32              powerpc-@VENDOR@-@OS@
 powerpc.*-.*-.*                WORDSIZE64              powerpc64-@VENDOR@-@OS@
-sparc64-.*-.*          WORDSIZE32              sparc-@VENDOR@-@OS@
+sparc64.*-.*-.*                WORDSIZE32              sparc-@VENDOR@-@OS@
 sparc.*-.*-.*          WORDSIZE64              sparc64-@VENDOR@-@OS@
 
 # Configuration                Library=version         Earliest symbol set (optional)
 # -------------                ---------------         ------------------------------
 
 # The interface to -lm depends mostly only on cpu, not on operating system.
-sparc64-.*-linux.*     libm=6                  GLIBC_2.2
+sparc64.*-.*-linux.*   libm=6                  GLIBC_2.2
 alpha.*-.*-linux.*     libm=6.1
 ia64-.*-linux.*                libm=6.1                GLIBC_2.2
 sh.*-.*-linux.*                libm=6                  GLIBC_2.2
@@ -58,7 +58,7 @@ sh.*-.*-linux.*               libm=6                  GLIBC_2.2
 alpha.*-.*-linux.*     libc=6.1
 ia64-.*-linux.*                libc=6.1                GLIBC_2.2
 sh.*-.*-linux.*                libc=6                  GLIBC_2.2
-sparc64-.*-linux.*     libc=6                  GLIBC_2.2
+sparc64.*-.*-linux.*   libc=6                  GLIBC_2.2
 .*-.*-linux.*          libc=6
 
 # libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release.
@@ -72,7 +72,7 @@ sparc64-.*-linux.*    libc=6                  GLIBC_2.2
 
 # The dynamic loader also requires different names.
 i.86-.*-linux.*                ld=ld-linux.so.2
-sparc64-.*-linux.*     ld=ld-linux.so.2        GLIBC_2.2
+sparc64.*-.*-linux.*   ld=ld-linux.so.2        GLIBC_2.2
 sparc.*-.*-linux.*     ld=ld-linux.so.2
 alpha.*-.*-linux.*     ld=ld-linux.so.2
 sh.*-.*-linux.*                ld=ld-linux.so.2        GLIBC_2.2
@@ -121,7 +121,7 @@ alpha.*-.*-linux.*  libcrypt=1.1
 alpha.*-.*-linux.*     libBrokenLocale=1.1
 ia64-.*-.*             libBrokenLocale=1       GLIBC_2.2
 sh.*-.*-.*             libBrokenLocale=1       GLIBC_2.2
-sparc64-.*-.*          libBrokenLocale=1       GLIBC_2.2
+sparc64.*-.*-.*                libBrokenLocale=1       GLIBC_2.2
 .*-.*-.*               libBrokenLocale=1
 
 # The real-time library from POSIX.1b.
index 7dff966e20011f15a639f41bf1d8efa94550241a..e8b1e226715c8726777ca32867d8a824ef1561e7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,02, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2002,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
@@ -30,9 +30,9 @@ static int was_in_f2;
 static char st2[32768];
 
 static void
-f1 (long a0, long a1, long a2, long a3)
+f1 (int a0, int a1, int a2, int a3)
 {
-  printf ("start f1(a0=%lx,a1=%lx,a2=%lx,a3=%lx)\n", a0, a1, a2, a3);
+  printf ("start f1(a0=%x,a1=%x,a2=%x,a3=%x)\n", a0, a1, a2, a3);
 
   if (a0 != 1 || a1 != 2 || a2 != 3 || a3 != -4)
     {
index 326bebff7fb0478efdd6b49d92c358fafd8e4c47..6747bc276ec629e0a759ec1655a53593c3fb14bb 100644 (file)
@@ -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
 /* 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
 
 /* 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)
 #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 */
index c9caac30d7520adf6b140fdded33c13d91e1f492..016f825f1d6edd30dd57ea60ed84c9cbe17ef430 100644 (file)
@@ -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;
index ff849716e0adfa4781cfe6fd68dfbc1874e05d24..223a47d2f2c2f9aab5db22356b8190c67cca902b 100644 (file)
@@ -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;
 
index 5b10142d39d0bfc29030d80fde6635572efbb11c..23e04ede0e6cd44844c25c314dbcec92c67695be 100644 (file)
@@ -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);
 
index cb5137cd76a8010ce8f08252fc5e94e08799f5a5..0c0d7d141880867678060e28cd5740e8157c8f26 100644 (file)
@@ -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;
index 4b7853029a096d71ea089daa1f0ebb753b3ee68f..b0f86dda4ec3d9fef194810797272f89658088e5 100644 (file)
        .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
index 4c7fb5bd232c362d354ff691e519ab4ef49f48e1..702dd755e66970b7b3c2802bf447e411dda47632 100644 (file)
@@ -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.  */
index 0ca56ccdd9d26bc53b2214f3e113ebe8a82a14bf..fcd98315db0f9314fb98484e8e837447614e50dc 100644 (file)
 
        .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
         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
index 35bcef4963b7aae0a35beb3ec87a0666ebee2c05..6bd55c06a1252f280105f9f0218ae979419c27f3 100644 (file)
        .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
index e6688a9b21c6769c4f35bd1c29cb3a92792966f4..222bc2a445cb438435c62caebed1a351c1bea14e 100644 (file)
 
        .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
 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
index 3709c8a69202b9469c100a0922ef81a478d8ef26..4ce0771908bfddbe8303d2436d4f983c1f9cf5ee 100644 (file)
 
        .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
        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
index 6120ecd6a35d443a521c4160a4f9a47c70984c6b..7c397171f577334aac2ff5c8bc9895c7660e7e24 100644 (file)
 
        .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
         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
index 6723593eedfec3fbf61549c9560348bdcdc3e55f..cf369dd839638710a9580c3f06c7f8d96cbf71b3 100644 (file)
 
        .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
 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
index 787ac9f7c81186f0eb1f3148c098c3bfdb0634e8..f3f337e3f73ea1fed658f963d2caafe0b594ce2b 100644 (file)
 
        .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
        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
index 76466ec9dd2b557eabf71481aedb93c771677180..ed92f20e28742ee0688938b783273988bfc07de0 100644 (file)
 
        .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
index f85527f4c4fb1327f75130e0834fbb9457d3f2c3..81e5c556c3689a5efd78045b6218261bfd91c996 100644 (file)
        .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
index c008c6cea0cf7ee0f7e17b7f9620945d0bd3b70a..df44cae0686129496b0ec1ff62a847f0f75017f8 100644 (file)
@@ -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.  */
index a3f7b96a91eb7b0f0f4d9346d3c5a6213e0b8f92..59933580174109f255fdd4fe9526d08f55bc4a76 100644 (file)
@@ -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)
index 7a51ef77dcee60834a4f85e7720f22ea882eb237..ac0a50cf8ee6b9f30947bfeb74ed752b4b9d81e6 100644 (file)
@@ -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)
index 2260ec54800e7beea8719f91ac0c014d0d868eb5..2e5bc798eb9f51f319c8d37010ee302eb7438b1f 100644 (file)
@@ -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
index 06683089ada69be3c77f2f3223f2a1be64322d93..a8a9cc47023f712ca4964627e349f6c1a8fad558 100644 (file)
@@ -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
     ;;
index b90de065afa53aff1d80061dd8af0335ca50cf64..43681f3251bc381bd649e74c2e9fca52d6661f84 100644 (file)
@@ -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
     ;;
index 29e54063481bdb2b6022ff8f768a61ae29e305d4..9cb2a634d591db157e3992bfe870abe2e3935421 100644 (file)
@@ -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 (file)
index 0000000..3ff5595
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdep.c>
index 95106d149fef6c7ce328e798ceca94306a3d1134..f91fc4f629a85932bba431e81ac83ca81d9157a0 100644 (file)
@@ -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
             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)
index 27ea9f89127fcddfc1ba949f95505a88a9a573fe..dbe0872616fc304360532f8c6691fbd9ad4fe7e9 100644 (file)
 
 #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)
index 911d5c6b39b2db54167ffd9e787da59378d00ed6..71a63d5b79c31c1818cc0e59257244f4ee2ed225 100644 (file)
@@ -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
index 3b135c8e864befd46b41a621e10a589a3ef8f449..16107455243054ca5a94045972d9ef27db2c3727 100644 (file)
    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)
index 45f5c44d5da6c270c3bdf943a8533aa50074d2fe..c808a97fc55bb6402944abf9165ef553cb85c323 100644 (file)
 #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__ */
 
index 1fabd11f710b6102a651355213fa92d03da63b8c..134ce789f77b6c05822456fd548bbc6e1b3ebafa 100644 (file)
@@ -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)
index 0e1025ff6ace184aed9995af6d2bd26ef154cabb..ebfce9e2c51fc728e4b5147a46e43e0a7a379ad8 100644 (file)
@@ -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
        .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)
index 5ccedff21ac7d34f777a28df0c5c385b090cdd3d..14f244e6280506f068a0cea4096d327c4276ba8f 100644 (file)
 
 #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)
index 4e0bc96d2205ca1aaf7c2e0edf1ec49cb185d3a8..90d47c18fa42be582a167ec7e6bdf47dd3694dc3 100644 (file)
 .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
 
index 1a9359af5b2e0d743b93ba924891376966fcf0b5..ab1690bb42dd95e17c3b318f12ad7c9eeb2f3fb3 100644 (file)
@@ -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)  */
index 7a8b205538c280346135d369a2e526cc333d1aa0..353705b4aced96b131dc8dc0815b6cacce44349a 100644 (file)
@@ -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)
index 27bd086206ddc1fc33399429a529ad8832dfaa1b..27487d8ed9e43332182a4e5c5e13b0ab63744590 100644 (file)
@@ -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)
index dfc38f151ab78e550c78770134d215bf799d21c5..f156f9241a32ef38412c590bed52d948bb7069fe 100644 (file)
 #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 (file)
index b031238..0000000
+++ /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 (file)
index 0000000..f864145
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/powerpc/sysdep.c>
index 3cf6aa70bba29d706b9b3b46a5cb521e48f8e6c7..f9f6f1bfa566bb1d0470391cf97b4a810870aa95 100644 (file)
@@ -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.  */