* configure.in: Recognize --enable-bind-now.
	* elf/dynamic-link.h (elf_get_dynamic_info): Allow bind-now flags
	in ld.so.
	* Makerules (LDFLAGS-c.so): Add -z now if so configured.
	* elf/Makefile ($(objpfx)ld.so): Likewise.
	* config.make.in (bind-now): New definition.
This commit is contained in:
Ulrich Drepper 2004-03-06 09:51:56 +00:00
parent 42af49f875
commit 4df8c11d26
7 changed files with 725 additions and 307 deletions

View File

@ -1,5 +1,12 @@
2004-03-06 Ulrich Drepper <drepper@redhat.com>
* configure.in: Recognize --enable-bind-now.
* elf/dynamic-link.h (elf_get_dynamic_info): Allow bind-now flags
in ld.so.
* Makerules (LDFLAGS-c.so): Add -z now if so configured.
* elf/Makefile ($(objpfx)ld.so): Likewise.
* config.make.in (bind-now): New definition.
* elf/dl-fini.c (_dl_fini): Combine _dl_debug_printf calls.
* elf/rtld.c (print_statistics): Likewise.

View File

@ -585,6 +585,10 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
LDLIBS-c.so += $(gnulib)
# Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -e __libc_main
# If lazy relocation is disabled add the -z now flag.
ifeq ($(bind-now),yes)
LDFLAGS-c.so += -Wl,-z,now
endif
# Pre-link the objects of libc_pic.a so that we can locally resolve
# COMMON symbols before we link against ld.so. This is because ld.so
# contains some of libc_pic.a already, which will prevent the COMMONs

View File

@ -58,6 +58,7 @@ have-forced-unwind = @libc_cv_forced_unwind@
have-fpie = @libc_cv_fpie@
have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
fno-unit-at-a-time = @fno_unit_at_a_time@
bind-now = @bindnow@
static-libgcc = @libc_cv_gcc_static_libgcc@

669
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -203,6 +203,13 @@ if test "x$hidden" = xno; then
AC_DEFINE(NO_HIDDEN)
fi
AC_ARG_ENABLE([bind-now],
AC_HELP_STRING([--enable-bind-now],
[disable lazy relocations in DSOs]),
[bindnow=$enableval],
[bindnow=no])
AC_SUBST(bindnow)
AC_CONFIG_SUBDIRS([ ])dnl Bonehead new Autoconf whines if we do it cleanly.
add_ons_pfx=
if test x"$add_ons" != x; then

View File

@ -1,4 +1,4 @@
# Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
# Copyright (C) 1995-2002, 2003, 2004 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
@ -256,16 +256,18 @@ $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
z-now-yes = -Wl,-z,now
$(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
@rm -f $@.lds
$(LINK.o) -nostdlib -nostartfiles -shared \
$(LINK.o) -nostdlib -nostartfiles -shared $(z-now-$(bind-now)) \
$(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
LC_ALL=C \
sed -e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
> $@.lds
$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
$(LDFLAGS-rtld) -Wl,-z,defs \
$(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
$(filter-out $(map-file),$^) $(load-map-file) \
-Wl,-soname=$(rtld-installed-name) -T $@.lds
rm -f $@.lds

View File

@ -159,10 +159,12 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
assert (info[DT_RELENT]->d_un.d_val == sizeof (ElfW(Rel)));
#endif
#ifdef RTLD_BOOTSTRAP
/* Only the bind now flags are allowed. */
assert (info[VERSYMIDX (DT_FLAGS_1)] == NULL
|| info[VERSYMIDX (DT_FLAGS_1)]->d_un.d_val == DF_1_NOW);
assert (info[DT_FLAGS] == NULL
|| info[DT_FLAGS]->d_un.d_val == DF_BIND_NOW);
/* Flags must not be set for ld.so. */
assert (info[DT_FLAGS] == NULL);
assert (info[VERSYMIDX (DT_FLAGS_1)] == NULL);
/* The dynamic linker should have none of these set. */
assert (info[DT_RUNPATH] == NULL);
assert (info[DT_RPATH] == NULL);
#else