summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ldso/dynlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 8d857d72..3c963e22 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -715,7 +715,7 @@ static void do_fini()
while (n--) ((void (*)(void))*--fn)();
}
#ifndef NO_LEGACY_INITFINI
- if (dyn[0] & (1<<DT_FINI))
+ if ((dyn[0] & (1<<DT_FINI)) && dyn[DT_FINI])
((void (*)(void))(p->base + dyn[DT_FINI]))();
#endif
}
@@ -738,7 +738,7 @@ static void do_init_fini(struct dso *p)
fini_head = p;
}
#ifndef NO_LEGACY_INITFINI
- if (dyn[0] & (1<<DT_INIT))
+ if ((dyn[0] & (1<<DT_INIT)) && dyn[DT_INIT])
((void (*)(void))(p->base + dyn[DT_INIT]))();
#endif
if (dyn[0] & (1<<DT_INIT_ARRAY)) {