|
@@ -255,15 +255,28 @@ void *dlopen(const char *libname, int flag)
|
|
|
}
|
|
|
if (tpnt1->init_flag & DL_OPENED) {
|
|
|
|
|
|
- tmp = alloca(sizeof(struct init_fini_list));
|
|
|
+ tmp = alloca(sizeof(struct init_fini_list));
|
|
|
tmp->tpnt = tpnt1;
|
|
|
tmp->next = runp->tpnt->init_fini;
|
|
|
runp->tpnt->init_fini = tmp;
|
|
|
|
|
|
- runp2->next = alloca(sizeof(*runp));
|
|
|
- runp2 = runp2->next;
|
|
|
- runp2->tpnt = tpnt1;
|
|
|
- runp2->next = NULL;
|
|
|
+ for (tmp=dep_list; tmp; tmp = tmp->next) {
|
|
|
+ if (tpnt1 == tmp->tpnt) {
|
|
|
+#ifdef __SUPPORT_LD_DEBUG__
|
|
|
+ if(_dl_debug)
|
|
|
+ fprintf(stderr, "Circular dependency, skipping '%s',\n",
|
|
|
+ tmp->tpnt->libname);
|
|
|
+#endif
|
|
|
+ tpnt1->usage_count--;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!tmp) {
|
|
|
+ runp2->next = alloca(sizeof(*runp));
|
|
|
+ runp2 = runp2->next;
|
|
|
+ runp2->tpnt = tpnt1;
|
|
|
+ runp2->next = NULL;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|