+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
-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.
* 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
+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):
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)
{
/* 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;
}
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;
{
/* stat failed, very strange. */
close_and_out:
- __close (fd);
+ if (fd >= 0)
+ __close (fd);
return NULL;
}
/* 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. */
{
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)
/* 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);
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;
}
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. */
|| 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. */
}
}
+ /* 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. */
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
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
--- /dev/null
+ # Local configure fragment for sysdeps/ia64/elf.
+
+cat >> confdefs.h <<\EOF
+#define PI_STATIC_AND_HIDDEN 1
+EOF
+
--- /dev/null
+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)