1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-05 19:35:52 +03:00
2003-05-14  Jakub Jelinek  <jakub@redhat.com>

	* elf/rtld.c (dl_main): For LD_TRACE_PRELINKING print search scope
	even if no DT_NEEDED is present.
This commit is contained in:
Ulrich Drepper
2003-05-14 21:40:32 +00:00
parent c9300aefcd
commit 81f3ac4c9a
4 changed files with 89 additions and 66 deletions

View File

@@ -1,3 +1,8 @@
2003-05-14 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (dl_main): For LD_TRACE_PRELINKING print search scope
even if no DT_NEEDED is present.
2003-05-13 David Mosberger <davidm@hpl.hp.com> 2003-05-13 David Mosberger <davidm@hpl.hp.com>
* sysdeps/unix/sysv/linux/ia64/setjmp.S: Fix the fix from * sysdeps/unix/sysv/linux/ia64/setjmp.S: Fix the fix from

View File

@@ -1262,10 +1262,6 @@ cannot allocate TLS data structures for initial thread");
important that we do this before real relocation, because the important that we do this before real relocation, because the
functions we call below for output may no longer work properly functions we call below for output may no longer work properly
after relocation. */ after relocation. */
if (! GL(dl_loaded)->l_info[DT_NEEDED])
_dl_printf ("\tstatically linked\n");
else
{
struct link_map *l; struct link_map *l;
if (GL(dl_debug_mask) & DL_DEBUG_PRELINK) if (GL(dl_debug_mask) & DL_DEBUG_PRELINK)
@@ -1287,10 +1283,8 @@ cannot allocate TLS data structures for initial thread");
: rtld_progname ?: "<main program>", : rtld_progname ?: "<main program>",
l->l_name[0] ? l->l_name l->l_name[0] ? l->l_name
: rtld_progname ?: "<main program>", : rtld_progname ?: "<main program>",
(int) sizeof l->l_map_start * 2, (int) sizeof l->l_map_start * 2, l->l_map_start,
l->l_map_start, (int) sizeof l->l_addr * 2, l->l_addr);
(int) sizeof l->l_addr * 2,
l->l_addr);
#ifdef USE_TLS #ifdef USE_TLS
if (l->l_tls_modid) if (l->l_tls_modid)
_dl_printf (" TLS(0x%Zx, 0x%0*Zx)\n", l->l_tls_modid, _dl_printf (" TLS(0x%Zx, 0x%0*Zx)\n", l->l_tls_modid,
@@ -1301,6 +1295,8 @@ cannot allocate TLS data structures for initial thread");
_dl_printf ("\n"); _dl_printf ("\n");
} }
} }
else if (! GL(dl_loaded)->l_info[DT_NEEDED])
_dl_printf ("\tstatically linked\n");
else else
{ {
for (l = GL(dl_loaded)->l_next; l; l = l->l_next) for (l = GL(dl_loaded)->l_next; l; l = l->l_next)
@@ -1312,7 +1308,6 @@ cannot allocate TLS data structures for initial thread");
l->l_name, (int) sizeof l->l_map_start * 2, l->l_name, (int) sizeof l->l_map_start * 2,
l->l_map_start); l->l_map_start);
} }
}
if (__builtin_expect (mode, trace) != trace) if (__builtin_expect (mode, trace) != trace)
for (i = 1; i < (unsigned int) _dl_argc; ++i) for (i = 1; i < (unsigned int) _dl_argc; ++i)

View File

@@ -1,3 +1,11 @@
2003-05-14 Jakub Jelinek <jakub@redhat.com>
* Makefile (crti-objs, crtn-objs): New variables.
(omit-deps, extra-objs): Add crtn.
($(objpfx)libpthread.so): Depend on both crti and crtn
and links to them in multidir.
($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
2003-05-12 Steven Munroe <sjmunroe@us.ibm.com> 2003-05-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h

View File

@@ -209,8 +209,25 @@ $(objpfx)libpthread_nonshared.a: $(addprefix $(objpfx),$(addsuffix .os,$(libpthr
$(AR) $(ARFLAGS) $@ $^ $(AR) $(ARFLAGS) $@ $^
ifeq ($(build-shared),yes) ifeq ($(build-shared),yes)
extra-objs += crti.o
omit-deps += crti # Set the `multidir' variable by grabbing the variable from the compiler.
# We do it once and save the result in a generated makefile.
-include $(objpfx)multidir.mk
$(objpfx)multidir.mk: $(common-objpfx)config.make
dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
echo "multidir := $$dir" > $@T
mv -f $@T $@
crti-objs := crti.o
crtn-objs := crtn.o
ifneq (,$(patsubst .,,$(multidir)))
generated-dirs := $(firstword $(subst /, , $(multidir)))
crti-objs += $(multidir)/crti.o
crtn-objs += $(multidir)/crtn.o
omit-deps += $(multidir)/crti $(multidir)/crtn
endif
extra-objs += $(crti-objs) $(crtn-objs)
omit-deps += crti crtn
CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions
endif endif
@@ -292,8 +309,9 @@ $(objpfx)tst-cond11: $(common-objpfx)rt/librt.a
endif endif
extra-B-pthread.so = -B$(common-objpfx)nptl/ extra-B-pthread.so = -B$(common-objpfx)nptl/
$(objpfx)libpthread.so: $(objpfx)crti.o $(objpfx)libpthread.so: $(addprefix $(objpfx),$(crti-objs) $(crtn-objs))
$(objpfx)libpthread.so: +preinit += $(objpfx)crti.o $(objpfx)libpthread.so: +preinit += $(addprefix $(objpfx),$(crti-objs))
$(objpfx)libpthread.so: +postinit += $(addprefix $(objpfx),$(crtn-objs))
# Depend on libc.so so a DT_NEEDED is generated in the shared objects. # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by # This ensures they will load libc.so for needed symbols if loaded by
@@ -339,6 +357,10 @@ $(objpfx)crti.S: $(objpfx)pt-initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \ sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \ -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@ -e '/@TRAILER_BEGINS/,$$p' $< > $@
$(objpfx)crtn.S: $(objpfx)pt-initfini.s
sed -n -e '1,/@HEADER_ENDS/p' \
-e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
-e '/@TRAILER_BEGINS/,$$p' $< > $@
$(objpfx)defs.h: $(objpfx)pt-initfini.s $(objpfx)defs.h: $(objpfx)pt-initfini.s
sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \ sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
@@ -347,26 +369,19 @@ $(objpfx)defs.h: $(objpfx)pt-initfini.s
$(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h $(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h
$(compile.S) -g0 $(ASFLAGS-.os) -o $@ $(compile.S) -g0 $(ASFLAGS-.os) -o $@
# Set the `multidir' variable by grabbing the variable from the compiler. $(objpfx)crtn.o: $(objpfx)crtn.S $(objpfx)defs.h
# We do it once and save the result in a generated makefile. $(compile.S) -g0 $(ASFLAGS-.os) -o $@
-include $(objpfx)multidir.mk
$(objpfx)multidir.mk: $(common-objpfx)config.make
dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
echo "multidir := $$dir" > $@T
mv -f $@T $@
generated += crti.S defs.h pt-initfini.s multidir.mk ifneq ($(multidir),.)
extra-objs += crti.o
omit-deps += crti
ifneq (,$(filter-out .,$(multidir)))
generated-dirs := $(firstword $(subst /, , $(multidir)))
extra-objs += $(multidir)/crti.o
omit-deps += $(multidir)/crti
$(objpfx)$(multidir)/crti.o: $(objpfx)crti.o $(objpfx)$(multidir)/ $(objpfx)$(multidir)/crti.o: $(objpfx)crti.o $(objpfx)$(multidir)/
ln -f $< $@ ln -f $< $@
$(objpfx)$(multidir)/crtn.o: $(objpfx)crtn.o $(objpfx)$(multidir)/
ln -f $< $@
endif endif
generated += crti.S crtn.S defs.h pt-initfini.s
generated += $(objpfx)tst-atfork2.mtrace \ generated += $(objpfx)tst-atfork2.mtrace \
$(addsuffix .so,$(strip $(modules-names))) $(addsuffix .so,$(strip $(modules-names)))