Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 28 Aug 2002 22:37:20 +0000 (22:37 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 28 Aug 2002 22:37:20 +0000 (22:37 +0000)
2002-08-28  Jakub Jelinek  <jakub@redhat.com>

* sysdeps/ia64/elf/configure.in (PI_STATIC_AND_HIDDEN): Define
unconditionally.
* sysdeps/alpha/elf/configure.in (libc_cv_alpha_hidden_gprel): New
check.
(PI_STATIC_AND_HIDDEN): Define if check succeeded.

2002-08-28  Jakub Jelinek  <jakub@redhat.com>

* locale/loadarchive.c (_nl_load_locale_from_archive): Add fd >= 0
check to close_and_out close.  Replace return NULL statements where
fd might be >= 0 with goto close_and_out.  Close the file descriptor
when it is no longer needed.

ChangeLog
NEWS
linuxthreads/ChangeLog
linuxthreads/sysdeps/pthread/timer_routines.c
locale/loadarchive.c
sysdeps/alpha/elf/configure
sysdeps/alpha/elf/configure.in
sysdeps/ia64/elf/configure [new file with mode: 0644]
sysdeps/ia64/elf/configure.in [new file with mode: 0644]

index 183b31a..70a07d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2002-08-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/ia64/elf/configure.in (PI_STATIC_AND_HIDDEN): Define
+       unconditionally.
+       * sysdeps/alpha/elf/configure.in (libc_cv_alpha_hidden_gprel): New
+       check.
+       (PI_STATIC_AND_HIDDEN): Define if check succeeded.
+
+2002-08-28  Jakub Jelinek  <jakub@redhat.com>
+
+       * locale/loadarchive.c (_nl_load_locale_from_archive): Add fd >= 0
+       check to close_and_out close.  Replace return NULL statements where
+       fd might be >= 0 with goto close_and_out.  Close the file descriptor
+       when it is no longer needed.
+
 2002-08-28  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/s390/s390-64/dl-machine.h: Avoid unescaped newlines in
diff --git a/NEWS b/NEWS
index 45049b7..8103f69 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2002-8-21
+GNU C Library NEWS -- history of user-visible changes.  2002-8-28
 Copyright (C) 1992-2000,01,02 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -47,6 +47,10 @@ Version 2.3
 
 * Loading of locale data is faster due to the introduction of a locale
   archive.  Implemented by Roland McGrath and Ulrich Drepper.
+
+* Startup times are significantly reduced by not using exported functions
+  inside the library itself.  Changes by Jakub Jelinek, Roland McGrath,
+  and Ulrich Drepper.
 \f
 Version 2.2.5
 
index 0d3f95c..434e7c7 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-28  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/pthread/timer_routines.c (thread_func): Change return
+       type to void and add casts in use to avoid warnings wit all gcc
+       versions.
+
 2002-08-08  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/bits/local_lim.h (PTHREAD_THREADS_MAX):
index 110448c..86fae2a 100644 (file)
@@ -369,7 +369,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer)
    function is to wait on the thread's timer queue and expire the
    timers in chronological order as close to their scheduled time as
    possible.  */
-static void *
+static void
 __attribute__ ((noreturn))
 thread_func (void *arg)
 {
@@ -449,9 +449,6 @@ thread_func (void *arg)
   /* This macro will never be executed since the while loop loops
      forever - but we have to add it for proper nesting.  */
   pthread_cleanup_pop (1);
-
-  /* NOTREACHED */
-  return NULL;
 }
 
 
@@ -492,7 +489,8 @@ __timer_thread_start (struct thread_node *thread)
   assert (!thread->exists);
   thread->exists = 1;
 
-  if (pthread_create (&thread->id, &thread->attr, thread_func, thread) != 0)
+  if (pthread_create (&thread->id, &thread->attr,
+                     (void (*) (void *)) thread_func, thread) != 0)
     {
       thread->exists = 0;
       retval = -1;
index ab824a7..e8235c9 100644 (file)
@@ -211,7 +211,8 @@ _nl_load_locale_from_archive (int category, const char **namep)
        {
          /* stat failed, very strange.  */
        close_and_out:
-         __close (fd);
+         if (fd >= 0)
+           __close (fd);
          return NULL;
        }
 
@@ -262,7 +263,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
 
   /* If there is no archive or it cannot be loaded for some reason fail.  */
   if (__builtin_expect (headmap.ptr == NULL, 0))
-    return NULL;
+    goto close_and_out;
 
   /* We have the archive available.  To find the name we first have to
      determine its hash value.  */
@@ -281,7 +282,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
     {
       if (namehashtab[idx].name_offset == 0)
        /* Not found.  */
-       return NULL;
+       goto close_and_out;
 
       if (namehashtab[idx].hashval == hval
          && strcmp (name, headmap.ptr + namehashtab[idx].name_offset) == 0)
@@ -295,7 +296,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
 
   /* We found an entry.  It might be a placeholder for a removed one.  */
   if (namehashtab[idx].locrec_offset == 0)
-    return NULL;
+    goto close_and_out;
 
   locrec = (struct locrecent *) (headmap.ptr + namehashtab[idx].locrec_offset);
 
@@ -309,7 +310,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
            if (locrec->record[cnt].offset + locrec->record[cnt].len
                > headmap.len)
              /* The archive locrectab contains bogus offsets.  */
-             return NULL;
+             goto close_and_out;
            results[cnt].addr = headmap.ptr + locrec->record[cnt].offset;
            results[cnt].len = locrec->record[cnt].len;
          }
@@ -376,7 +377,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
              to = ranges[upper].from + ranges[upper].len;
              if (to > (size_t) archive_stat.st_size)
                /* The archive locrectab contains bogus offsets.  */
-               return NULL;
+               goto close_and_out;
              to = (to + ps - 1) & ~(ps - 1);
 
              /* If a range is already mmaped in, stop.  */
@@ -404,21 +405,21 @@ _nl_load_locale_from_archive (int category, const char **namep)
                  || st.st_mtime != archive_stat.st_mtime
                  || st.st_dev != archive_stat.st_dev
                  || st.st_ino != archive_stat.st_ino)
-               return NULL;
+               goto close_and_out;
            }
 
          /* Map the range from the archive.  */
          addr = __mmap64 (NULL, to - from, PROT_READ, MAP_FILE|MAP_COPY,
                           fd, from);
          if (addr == MAP_FAILED)
-           return NULL;
+           goto close_and_out;
 
          /* Allocate a record for this mapping.  */
          newp = (struct archmapped *) malloc (sizeof (struct archmapped));
          if (newp == NULL)
            {
              (void) __munmap (addr, to - from);
-             return NULL;
+             goto close_and_out;
            }
 
          /* And queue it.  */
@@ -443,6 +444,11 @@ _nl_load_locale_from_archive (int category, const char **namep)
        }
     }
 
+  /* We don't need the file descriptor any longer.  */
+  if (fd >= 0)
+    __close (fd);
+  fd = -1;
+
   /* We succeeded in mapping all the necessary regions of the archive.
      Now we need the expected data structures to point into the data.  */
 
index 3346b8e..ab3c093 100755 (executable)
@@ -58,3 +58,38 @@ EOF
 
 fi
 fi
+
+echo $ac_n "checking for GP relative module local relocs""... $ac_c" 1>&6
+echo "configure:20: checking for GP relative module local relocs" >&5
+if eval "test \"`echo '$''{'libc_cv_alpha_hidden_gprel'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<\EOF
+static int bar;
+int baz __attribute__((visibility("hidden")));
+
+int foo (void)
+{
+  return bar + baz;
+}
+EOF
+
+libc_cv_alpha_hidden_gprel=no
+if { ac_try='${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 1>&5'; { (eval echo configure:35: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+  if grep -q 'bar.*!gprel' conftest.s \
+     && grep -q 'baz.*!gprel' conftest.s \
+     && ! grep -q 'bar.*!literal' conftest.s \
+     && ! grep -q 'baz.*!literal' conftest.s; then
+    libc_cv_alpha_hidden_gprel=yes
+  fi
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$libc_cv_alpha_hidden_gprel" 1>&6
+if test $libc_cv_alpha_hidden_gprel = yes; then
+  cat >> confdefs.h <<\EOF
+#define PI_STATIC_AND_HIDDEN 1
+EOF
+
+fi
index 7548046..29daf4f 100644 (file)
@@ -51,3 +51,29 @@ if test $libc_cv_alpha_tls = yes; then
   AC_DEFINE(HAVE_TLS_SUPPORT)
 fi
 fi
+
+AC_CACHE_CHECK(for GP relative module local relocs, libc_cv_alpha_hidden_gprel, [dnl
+cat > conftest.c <<\EOF
+static int bar;
+int baz __attribute__((visibility("hidden")));
+
+int foo (void)
+{
+  return bar + baz;
+}
+EOF
+dnl
+
+libc_cv_alpha_hidden_gprel=no
+if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 1>&AC_FD_CC); then
+  if grep -q 'bar.*!gprel' conftest.s \
+     && grep -q 'baz.*!gprel' conftest.s \
+     && ! grep -q 'bar.*!literal' conftest.s \
+     && ! grep -q 'baz.*!literal' conftest.s; then
+    libc_cv_alpha_hidden_gprel=yes
+  fi
+fi
+rm -f conftest*])
+if test $libc_cv_alpha_hidden_gprel = yes; then
+  AC_DEFINE(PI_STATIC_AND_HIDDEN)
+fi
diff --git a/sysdeps/ia64/elf/configure b/sysdeps/ia64/elf/configure
new file mode 100644 (file)
index 0000000..c2a514c
--- /dev/null
@@ -0,0 +1,6 @@
+ # Local configure fragment for sysdeps/ia64/elf.
+
+cat >> confdefs.h <<\EOF
+#define PI_STATIC_AND_HIDDEN 1
+EOF
+
diff --git a/sysdeps/ia64/elf/configure.in b/sysdeps/ia64/elf/configure.in
new file mode 100644 (file)
index 0000000..104c997
--- /dev/null
@@ -0,0 +1,7 @@
+sinclude(./aclocal.m4)dnl Autoconf lossage
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/ia64/elf.
+
+dnl It is always possible to access static and hidden symbols in an
+dnl position independent way.
+AC_DEFINE(PI_STATIC_AND_HIDDEN)