Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so Do not put objects on _rtld_list_main on a...



details:   https://anonhg.NetBSD.org/src/rev/0a686325b7e2
branches:  trunk
changeset: 537597:0a686325b7e2
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Thu Oct 03 01:09:21 2002 +0000

description:
Do not put objects on _rtld_list_main on any DAG member list -- any symbol we
will have already been found during the _rtld_list_main walk, so there's no
point in doing it again.

diffstat:

 libexec/ld.elf_so/rtld.c |  9 ++++++---
 libexec/ld.elf_so/rtld.h |  5 +++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 225bdecc9250 -r 0a686325b7e2 libexec/ld.elf_so/rtld.c
--- a/libexec/ld.elf_so/rtld.c  Wed Oct 02 21:48:00 2002 +0000
+++ b/libexec/ld.elf_so/rtld.c  Thu Oct 03 01:09:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld.c,v 1.82 2002/09/26 22:26:26 mycroft Exp $         */
+/*     $NetBSD: rtld.c,v 1.83 2002/10/03 01:09:21 mycroft Exp $         */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -405,8 +405,10 @@
        if (_rtld_load_needed_objects(_rtld_objmain, RTLD_GLOBAL) == -1)
                _rtld_die();
 
-       for (obj = _rtld_objlist;  obj != NULL;  obj = obj->next)
+       for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {
+               obj->main = 1;
                _rtld_objlist_add(&_rtld_list_main, obj);
+       }
 
        dbg(("relocating objects"));
        if (_rtld_relocate_objects(_rtld_objmain, bind_now) == -1)
@@ -498,7 +500,8 @@
        const Needed_Entry *needed;
 
        _rtld_objlist_add(&obj->dldags, root);
-       _rtld_objlist_add(&root->dagmembers, obj);
+       if (!obj->main)
+               _rtld_objlist_add(&root->dagmembers, obj);
        for (needed = obj->needed; needed != NULL; needed = needed->next)
                if (needed->obj != NULL)
                        _rtld_init_dag1(root, needed->obj);
diff -r 225bdecc9250 -r 0a686325b7e2 libexec/ld.elf_so/rtld.h
--- a/libexec/ld.elf_so/rtld.h  Wed Oct 02 21:48:00 2002 +0000
+++ b/libexec/ld.elf_so/rtld.h  Thu Oct 03 01:09:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld.h,v 1.60 2002/09/26 20:42:10 mycroft Exp $         */
+/*     $NetBSD: rtld.h,v 1.61 2002/10/03 01:09:21 mycroft Exp $         */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -182,7 +182,8 @@
                        symbolic:1,     /* True if generated with
                                         * "-Bsymbolic" */
                        printed:1,      /* True if ldd has printed it */
-                       isdynamic:1;    /* True if this is a pure PIC object */
+                       isdynamic:1,    /* True if this is a pure PIC object */
+                       main:1;         /* True if on _rtld_list_main */
 
        struct link_map linkmap;        /* for GDB */
 



Home | Main Index | Thread Index | Old Index