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() {
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
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
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
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
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
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
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
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
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
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
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
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
# 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
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 ()
{
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
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
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);
}
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
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 };
}
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
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"
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
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
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()
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
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
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
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
# 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
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
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
/* 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
/* 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: ",
+ l->l_name[0] ? l->l_name : _dl_argv[0], "\n\n", NULL);
+
+ /* Now run the local constructors. There are two forms of them:
+ - the one named by DT_INIT
+ - the others in the DT_INIT_ARRAY.
+ */
+ if (l->l_info[DT_INIT] != NULL)
+ {
+ init_t init = (init_t) DL_DT_INIT_ADDRESS
+ (l, l->l_addr + l->l_info[DT_INIT]->d_un.d_ptr);
+
+ /* Call the function. */
+ init (argc, argv, env);
+ }
+
+ /* Next see whether there is an array with initialization functions. */
+ if (l->l_info[DT_INIT_ARRAY] != NULL)
+ {
+ unsigned int j;
+ unsigned int jm;
+ ElfW(Addr) *addrs;
+
+ jm = l->l_info[DT_INIT_ARRAYSZ]->d_un.d_val / sizeof (ElfW(Addr));
+
+ addrs = (ElfW(Addr) *) (l->l_info[DT_INIT_ARRAY]->d_un.d_ptr
+ + l->l_addr);
+ for (j = 0; j < jm; ++j)
+ ((init_t) addrs[j]) (argc, argv, env);
+ }
+}
+
void
internal_function
struct r_debug *r;
unsigned int i;
+ if (_dl_initfirst != NULL)
+ {
+ call_init (_dl_initfirst, argc, argv, env);
+ _dl_initfirst = NULL;
+ }
+
/* Don't do anything if there is no preinit array. */
if (preinit_array != NULL
&& (i = preinit_array->d_un.d_val / sizeof (ElfW(Addr))) > 0)
i = main_map->l_searchlist.r_nlist;
while (i-- > 0)
- {
- struct link_map *l = main_map->l_initfini[i];
- init_t init;
-
- if (l->l_init_called)
- /* This object is all done. */
- continue;
-
- /* 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)
- continue;
-
- /* Are there any constructors? */
- if (l->l_info[DT_INIT] == NULL && l->l_info[DT_INIT_ARRAY] == NULL)
- continue;
-
- /* Print a debug message if wanted. */
- if (__builtin_expect (_dl_debug_impcalls, 0))
- _dl_debug_message (1, "\ncalling init: ",
- l->l_name[0] ? l->l_name : _dl_argv[0],
- "\n\n", NULL);
-
- /* Now run the local constructors. There are two forms of them:
- - the one named by DT_INIT
- - the others in the DT_INIT_ARRAY.
- */
- if (l->l_info[DT_INIT] != NULL)
- {
- init = (init_t) DL_DT_INIT_ADDRESS
- (l, l->l_addr + l->l_info[DT_INIT]->d_un.d_ptr);
-
- /* Call the function. */
- init (argc, argv, env);
- }
-
- /* Next see whether there is an array with initialization functions. */
- if (l->l_info[DT_INIT_ARRAY] != NULL)
- {
- unsigned int j;
- unsigned int jm;
- ElfW(Addr) *addrs;
-
- jm = l->l_info[DT_INIT_ARRAYSZ]->d_un.d_val / sizeof (ElfW(Addr));
-
- addrs = (ElfW(Addr) *) (l->l_info[DT_INIT_ARRAY]->d_un.d_ptr
- + l->l_addr);
- for (j = 0; j < jm; ++j)
- ((init_t) addrs[j]) (argc, argv, env);
- }
- }
+ call_init (main_map->l_initfini[i], argc, argv, env);
/* Notify the debugger all new objects are now ready to go. */
r->r_state = RT_CONSISTENT;