aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-02 06:19:24 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-02 06:19:24 +0000
commit5d9167133cd1b614e2841eceba5d6c3828059254 (patch)
treed00e4cedc2f49111343107cad7c53ffc08ad23ef
parent70dc5068f8105942b3ffa7ef57fbb88b6d4ce75a (diff)
downloadglibc-5d9167133cd1b614e2841eceba5d6c3828059254.tar.xz
glibc-5d9167133cd1b614e2841eceba5d6c3828059254.zip
Update.
2001-02-01 Ulrich Drepper <drepper@redhat.com> * Makerules (build-shlib): Add $(extra-B-$(@F:lib%.so=%).so). * configure.in: Test for -z initfirst linker option. * config.make.in: Add have-z-initfirst. * elf/dl-init.c (_dl_init): Split out actual initialization code in new function call_init. If _dl_initfirst is non-NULL initialize first. * elf/dl-load.c (_dl_map_from_fd): If DF_1_INITFIRST flag is set remember object in _dl_initfirst. * elf/soinit.c: Remove special support for calling __pthread_initialize_minimal. * conform/conformtest.pl: Add missing $prepend in type test. * elf/elf.h (SHT_CHECKSUM): New definition. * posix/tst-fnmatch.input: Add tests for [. .] in locales.
-rw-r--r--ChangeLog17
-rw-r--r--Makerules5
-rw-r--r--config.make.in1
-rwxr-xr-xconfigure109
-rw-r--r--configure.in14
-rw-r--r--conform/conformtest.pl1
-rw-r--r--elf/dl-init.c120
-rw-r--r--elf/dl-load.c7
-rw-r--r--elf/elf.h1
-rw-r--r--elf/soinit.c8
-rw-r--r--posix/tst-fnmatch.input6
11 files changed, 179 insertions, 110 deletions
diff --git a/ChangeLog b/ChangeLog
index c7a1d40bba..bcd901d42d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,24 @@
+2001-02-01 Ulrich Drepper <drepper@redhat.com>
+
+ * Makerules (build-shlib): Add $(extra-B-$(@F:lib%.so=%).so).
+ * configure.in: Test for -z initfirst linker option.
+ * config.make.in: Add have-z-initfirst.
+ * elf/dl-init.c (_dl_init): Split out actual initialization code in
+ new function call_init. If _dl_initfirst is non-NULL initialize first.
+ * elf/dl-load.c (_dl_map_from_fd): If DF_1_INITFIRST flag is set
+ remember object in _dl_initfirst.
+ * elf/soinit.c: Remove special support for calling
+ __pthread_initialize_minimal.
+
+ * conform/conformtest.pl: Add missing $prepend in type test.
+
2001-01-31 Ulrich Drepper <drepper@redhat.com>
+ * elf/elf.h (SHT_CHECKSUM): New definition.
+
* posix/fnmatch_loop.c: Remove incorrect reverse condition in
[. .] matching. Patch by Isamu Hasegawa <isamu@yamato.ibm.com>.
+ * posix/tst-fnmatch.input: Add tests for [. .] in locales.
2001-01-31 Mark Kettenis <kettenis@gnu.org>
diff --git a/Makerules b/Makerules
index 607db6794d..5c9b757ea9 100644
--- a/Makerules
+++ b/Makerules
@@ -1,5 +1,4 @@
-# Copyright (C) 1991,92,93,94,95,96,97,98,99,2000
-# Free Software Foundation, Inc.
+# Copyright (C) 1991-1999, 2000,2001 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
@@ -416,7 +415,7 @@ lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(+interp)
define build-shlib
$(LINK.o) -shared -Wl,-O1 -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
- -B$(csu-objpfx) $(load-map-file) \
+ $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) $(load-map-file) \
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
diff --git a/config.make.in b/config.make.in
index 8b8ea9ed2d..9c15cecda9 100644
--- a/config.make.in
+++ b/config.make.in
@@ -39,6 +39,7 @@ elf = @elf@
have-protected = @libc_cv_asm_protected_directive@
have-z-nodelete = @libc_cv_z_nodelete@
have-z-nodlopen = @libc_cv_z_nodlopen@
+have-z-initfirst = @libc_cv_z_initfirst@
have-initfini = @libc_cv_have_initfini@
need-nopic-initfini = @nopic_initfini@
with-cvs = @with_cvs@
diff --git a/configure b/configure
index b0ff1d192d..3d8dacdc60 100755
--- a/configure
+++ b/configure
@@ -2735,16 +2735,36 @@ fi
echo "$ac_t""$libc_cv_z_nodlopen" 1>&6
+
+ echo $ac_n "checking for -z initfirst option""... $ac_c" 1>&6
+echo "configure:2741: checking for -z initfirst option" >&5
+if eval "test \"`echo '$''{'libc_cv_z_initfirst'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+int _start (void) { return 42; }
+EOF
+ if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -Wl,--enable-new-dtags,-z,initfirst 1>&5'; { (eval echo configure:2748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ then
+ libc_cv_z_initfirst=yes
+ else
+ libc_cv_z_initfirst=no
+ fi
+ rm -f conftest*
+fi
+
+echo "$ac_t""$libc_cv_z_initfirst" 1>&6
+
fi
if test $elf != yes; then
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
-echo "configure:2743: checking for .init and .fini sections" >&5
+echo "configure:2763: checking for .init and .fini sections" >&5
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2748 "configure"
+#line 2768 "configure"
#include "confdefs.h"
int main() {
@@ -2753,7 +2773,7 @@ asm (".section .init");
asm ("${libc_cv_dot_text}");
; return 0; }
EOF
-if { (eval echo configure:2757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
@@ -2776,7 +2796,7 @@ fi
if test $elf = yes -a $gnu_ld = yes; then
echo $ac_n "checking whether cc puts quotes around section names""... $ac_c" 1>&6
-echo "configure:2780: checking whether cc puts quotes around section names" >&5
+echo "configure:2800: checking whether cc puts quotes around section names" >&5
if eval "test \"`echo '$''{'libc_cv_have_section_quotes'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2813,19 +2833,19 @@ if test $elf = yes; then
else
if test $ac_cv_prog_cc_works = yes; then
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2817: checking for _ prefix on C symbol names" >&5
+echo "configure:2837: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2822 "configure"
+#line 2842 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() {
glibc_foobar ();
; return 0; }
EOF
-if { (eval echo configure:2829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
@@ -2840,17 +2860,17 @@ fi
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
else
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2844: checking for _ prefix on C symbol names" >&5
+echo "configure:2864: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2849 "configure"
+#line 2869 "configure"
#include "confdefs.h"
void underscore_test(void) {
return; }
EOF
-if { (eval echo configure:2854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if grep _underscore_test conftest* >/dev/null; then
rm -f conftest*
libc_cv_asm_underscores=yes
@@ -2882,7 +2902,7 @@ if test $elf = yes; then
fi
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
-echo "configure:2886: checking for assembler .weak directive" >&5
+echo "configure:2906: checking for assembler .weak directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2905,7 +2925,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
if test $libc_cv_asm_weak_directive = no; then
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
-echo "configure:2909: checking for assembler .weakext directive" >&5
+echo "configure:2929: checking for assembler .weakext directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2945,14 +2965,14 @@ fi
case "${host_cpu}-${host_os}" in
hppa*linux*)
echo $ac_n "checking for assembler line separator""... $ac_c" 1>&6
-echo "configure:2949: checking for assembler line separator" >&5
+echo "configure:2969: checking for assembler line separator" >&5
if eval "test \"`echo '$''{'libc_cv_asm_line_sep'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.s <<EOF
nop ; is_old_puffin
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_line_sep='!'
else
if test -z "$enable_hacker_mode"; then
@@ -2974,7 +2994,7 @@ EOF
esac
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
-echo "configure:2978: checking for ld --no-whole-archive" >&5
+echo "configure:2998: checking for ld --no-whole-archive" >&5
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2985,7 +3005,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -Wl,--no-whole-archive
- -o conftest conftest.c 1>&5'; { (eval echo configure:2989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:3009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
@@ -2999,7 +3019,7 @@ if test $libc_cv_ld_no_whole_archive = yes; then
fi
echo $ac_n "checking for gcc -fexceptions""... $ac_c" 1>&6
-echo "configure:3003: checking for gcc -fexceptions" >&5
+echo "configure:3023: checking for gcc -fexceptions" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_exceptions'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3010,7 +3030,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -fexceptions
- -o conftest conftest.c 1>&5'; { (eval echo configure:3014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:3034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_exceptions=yes
else
libc_cv_gcc_exceptions=no
@@ -3025,14 +3045,14 @@ fi
if test "$base_machine" = alpha ; then
echo $ac_n "checking for function ..ng prefix""... $ac_c" 1>&6
-echo "configure:3029: checking for function ..ng prefix" >&5
+echo "configure:3049: checking for function ..ng prefix" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_alpha_ng_prefix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
foo () { }
EOF
-if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:3036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:3056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_gcc_alpha_ng_prefix=yes
else
@@ -3059,19 +3079,19 @@ if test "$host_cpu" = powerpc ; then
# Check for a bug present in at least versions 2.8.x of GCC
# and versions 1.0.x of EGCS.
echo $ac_n "checking whether clobbering cr0 causes problems""... $ac_c" 1>&6
-echo "configure:3063: checking whether clobbering cr0 causes problems" >&5
+echo "configure:3083: checking whether clobbering cr0 causes problems" >&5
if eval "test \"`echo '$''{'libc_cv_c_asmcr0_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3068 "configure"
+#line 3088 "configure"
#include "confdefs.h"
int tester(int x) { asm ("" : : : "cc"); return x & 123; }
int main() {
; return 0; }
EOF
-if { (eval echo configure:3075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_c_asmcr0_bug='no'
else
@@ -3093,12 +3113,12 @@ fi
fi
echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6
-echo "configure:3097: checking for DWARF2 unwind info support" >&5
+echo "configure:3117: checking for DWARF2 unwind info support" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
-#line 3102 "configure"
+#line 3122 "configure"
static char __EH_FRAME_BEGIN__;
_start ()
{
@@ -3125,7 +3145,7 @@ __bzero () {}
EOF
if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame_info
-nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=static
else
libc_cv_gcc_dwarf2_unwind_info=no
@@ -3133,7 +3153,7 @@ fi
if test $libc_cv_gcc_dwarf2_unwind_info = no; then
if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame
-nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=yes
else
libc_cv_gcc_dwarf2_unwind_info=no
@@ -3163,12 +3183,12 @@ EOF
esac
echo $ac_n "checking for __builtin_expect""... $ac_c" 1>&6
-echo "configure:3167: checking for __builtin_expect" >&5
+echo "configure:3187: checking for __builtin_expect" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_builtin_expect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
-#line 3172 "configure"
+#line 3192 "configure"
int foo (int a)
{
a = __builtin_expect (a, 10);
@@ -3176,7 +3196,7 @@ int foo (int a)
}
EOF
if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_builtin_expect=yes
else
libc_cv_gcc_builtin_expect=no
@@ -3193,12 +3213,12 @@ EOF
fi
echo $ac_n "checking for local label subtraction""... $ac_c" 1>&6
-echo "configure:3197: checking for local label subtraction" >&5
+echo "configure:3217: checking for local label subtraction" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_subtract_local_labels'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
-#line 3202 "configure"
+#line 3222 "configure"
int foo (int a)
{
static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
@@ -3211,7 +3231,7 @@ int foo (int a)
}
EOF
if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_subtract_local_labels=yes
else
libc_cv_gcc_subtract_local_labels=no
@@ -3228,7 +3248,7 @@ EOF
fi
echo $ac_n "checking for libgd""... $ac_c" 1>&6
-echo "configure:3232: checking for libgd" >&5
+echo "configure:3252: checking for libgd" >&5
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $libgd_include"
old_LDFLAGS="$LDFLAGS"
@@ -3236,14 +3256,14 @@ LDFLAGS="$LDFLAGS $libgd_ldflags"
old_LIBS="$LIBS"
LIBS="$LIBS -lgd -lpng -lz -lm"
cat > conftest.$ac_ext <<EOF
-#line 3240 "configure"
+#line 3260 "configure"
#include "confdefs.h"
#include <gd.h>
int main() {
gdImagePng (0, 0)
; return 0; }
EOF
-if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBGD=yes
else
@@ -3260,7 +3280,7 @@ echo "$ac_t""$LIBGD" 1>&6
echo $ac_n "checking size of long double""... $ac_c" 1>&6
-echo "configure:3264: checking size of long double" >&5
+echo "configure:3284: checking size of long double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3268,7 +3288,7 @@ else
ac_cv_sizeof_long_double=0
else
cat > conftest.$ac_ext <<EOF
-#line 3272 "configure"
+#line 3292 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -3279,7 +3299,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:3283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_double=`cat conftestval`
else
@@ -3347,7 +3367,7 @@ if test "$uname" = "sysdeps/generic"; then
fi
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
-echo "configure:3351: checking OS release for uname" >&5
+echo "configure:3371: checking OS release for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3369,7 +3389,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
uname_release="$libc_cv_uname_release"
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
-echo "configure:3373: checking OS version for uname" >&5
+echo "configure:3393: checking OS version for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3391,7 +3411,7 @@ else
fi
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
-echo "configure:3395: checking stdio selection" >&5
+echo "configure:3415: checking stdio selection" >&5
case $stdio in
libio) cat >> confdefs.h <<\EOF
@@ -3405,7 +3425,7 @@ echo "$ac_t""$stdio" 1>&6
# Test for old glibc 2.0.x headers so that they can be removed properly
# Search only in includedir.
echo $ac_n "checking for old glibc 2.0.x headers""... $ac_c" 1>&6
-echo "configure:3409: checking for old glibc 2.0.x headers" >&5
+echo "configure:3429: checking for old glibc 2.0.x headers" >&5
if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
then
old_glibc_headers=yes
@@ -3460,7 +3480,7 @@ if test $shared = default; then
fi
echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
-echo "configure:3464: checking whether -fPIC is default" >&5
+echo "configure:3484: checking whether -fPIC is default" >&5
if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3685,6 +3705,7 @@ s%@VERSIONING@%$VERSIONING%g
s%@libc_cv_asm_protected_directive@%$libc_cv_asm_protected_directive%g
s%@libc_cv_z_nodelete@%$libc_cv_z_nodelete%g
s%@libc_cv_z_nodlopen@%$libc_cv_z_nodlopen%g
+s%@libc_cv_z_initfirst@%$libc_cv_z_initfirst%g
s%@libc_cv_have_initfini@%$libc_cv_have_initfini%g
s%@no_whole_archive@%$no_whole_archive%g
s%@exceptions@%$exceptions%g
diff --git a/configure.in b/configure.in
index dfab7a365e..e52648fac6 100644
--- a/configure.in
+++ b/configure.in
@@ -973,6 +973,20 @@ EOF
fi
rm -f conftest*])
AC_SUBST(libc_cv_z_nodlopen)
+
+ AC_CACHE_CHECK(for -z initfirst option,
+ libc_cv_z_initfirst, [dnl
+ cat > conftest.c <<EOF
+int _start (void) { return 42; }
+EOF
+ if AC_TRY_COMMAND([${CC-cc} -shared -o conftest.so conftest.c -Wl,--enable-new-dtags,-z,initfirst 1>&AC_FD_CC])
+ then
+ libc_cv_z_initfirst=yes
+ else
+ libc_cv_z_initfirst=no
+ fi
+ rm -f conftest*])
+ AC_SUBST(libc_cv_z_initfirst)
fi
if test $elf != yes; then
diff --git a/conform/conformtest.pl b/conform/conformtest.pl
index a80e7d6c4f..5ae1cea45a 100644
--- a/conform/conformtest.pl
+++ b/conform/conformtest.pl
@@ -670,6 +670,7 @@ while ($#headers >= 0) {
# Generate a program to test for the availability of this type.
open (TESTFILE, ">$fnamebase.c");
+ print TESTFILE "$prepend";
print TESTFILE "#include <$h>\n";
if ($maybe_opaque == 1) {
print TESTFILE "$type *a;\n";
diff --git a/elf/dl-init.c b/elf/dl-init.c
index 627f823524..82e573712f 100644
--- a/elf/dl-init.c
+++ b/elf/dl-init.c
@@ -1,5 +1,5 @@
/* Return the next shared object initializer function not yet run.
- Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995,1996,1998,1999,2000,2001 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
@@ -27,6 +27,63 @@ typedef void (*init_t) (int, char **, char **);
/* Flag, nonzero during startup phase. */
extern int _dl_starting_up;
+/* The object to be initialized first. */
+extern struct link_map *_dl_initfirst;
+
+
+static void
+call_init (struct link_map *l, int argc, char **argv, char **env)
+{
+ if (l->l_init_called)
+ /* This object is all done. */
+ return;
+
+ /* Avoid handling this constructor again in case we have a circular
+ dependency. */
+ l->l_init_called = 1;
+
+ /* Check for object which constructors we do not run here. */
+ if (l->l_name[0] == '\0' && l->l_type == lt_executable)
+ return;
+
+ /* Are there any constructors? */
+ if (l->l_info[DT_INIT] == NULL && l->l_info[DT_INIT_ARRAY] == NULL)
+ return;
+
+ /* Print a debug message if wanted. */
+ if (__builtin_expect (_dl_debug_impcalls, 0))
+ _dl_debug_message (1, "\ncalling init: ",