View | Details | Raw Unified | Return to bug 25059
Collapse All | Expand All

(-)rtld.c (-2 / +9 lines)
Lines 1329-1334 Link Here
1329
    elm = NEW(Objlist_Entry);
1329
    elm = NEW(Objlist_Entry);
1330
    elm->obj = obj;
1330
    elm->obj = obj;
1331
    STAILQ_INSERT_TAIL(list, elm, link);
1331
    STAILQ_INSERT_TAIL(list, elm, link);
1332
    obj->global = true;
1332
}
1333
}
1333
1334
1334
static void
1335
static void
Lines 1581-1587 Link Here
1581
1582
1582
    if (obj) {
1583
    if (obj) {
1583
	obj->dl_refcount++;
1584
	obj->dl_refcount++;
1584
	if (mode & RTLD_GLOBAL && objlist_find(&list_global, obj) == NULL)
1585
	if (mode & RTLD_GLOBAL && !obj->global)
1585
	    objlist_push_tail(&list_global, obj);
1586
	    objlist_push_tail(&list_global, obj);
1586
	mode &= RTLD_MODEMASK;
1587
	mode &= RTLD_MODEMASK;
1587
	if (*old_obj_tail != NULL) {		/* We loaded something new. */
1588
	if (*old_obj_tail != NULL) {		/* We loaded something new. */
Lines 1915-1921 Link Here
1915
	}
1916
	}
1916
    }
1917
    }
1917
1918
1918
    /* Search all RTLD_GLOBAL objects. */
1919
    /* Search all RTLD_GLOBAL objects and their DAGs. */
1919
    if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) {
1920
    if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) {
1920
	symp = symlook_list(name, hash, &list_global, &obj, in_plt, &donelist);
1921
	symp = symlook_list(name, hash, &list_global, &obj, in_plt, &donelist);
1921
	if (symp != NULL &&
1922
	if (symp != NULL &&
Lines 1965-1970 Link Here
1965
		if (ELF_ST_BIND(def->st_info) != STB_WEAK)
1966
		if (ELF_ST_BIND(def->st_info) != STB_WEAK)
1966
		    break;
1967
		    break;
1967
	    }
1968
	    }
1969
	} else if (elm->obj->global) {
1970
	    /* search the DAGs of global objects */
1971
	    symp = symlook_list(name, hash, &elm->obj->dagmembers,
1972
	      defobj_out, in_plt, dlp);
1973
	    if (symp != NULL)
1974
		return symp;
1968
	}
1975
	}
1969
    }
1976
    }
1970
    if (def != NULL)
1977
    if (def != NULL)
(-)rtld.h (+1 lines)
Lines 155-160 Link Here
155
    bool traced;		/* Already printed in ldd trace output */
155
    bool traced;		/* Already printed in ldd trace output */
156
    bool jmpslots_done;		/* Already have relocated the jump slots */
156
    bool jmpslots_done;		/* Already have relocated the jump slots */
157
    bool init_done;		/* Already have added object to init list */
157
    bool init_done;		/* Already have added object to init list */
158
    bool global;		/* This object is on the global list */
158
159
159
    struct link_map linkmap;	/* for GDB */
160
    struct link_map linkmap;	/* for GDB */
160
    Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */
161
    Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */

Return to bug 25059