about summary refs log tree commit diff
path: root/src/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'src/ldso')
-rw-r--r--src/ldso/dynlink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 3a0bf95d..b5e4b72f 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -702,8 +702,10 @@ static void do_fini()
 			size_t *fn = (size_t *)(p->base + dyn[DT_FINI_ARRAY])+n;
 			while (n--) ((void (*)(void))*--fn)();
 		}
+#ifndef NO_LEGACY_INITFINI
 		if (dyn[0] & (1<<DT_FINI))
 			((void (*)(void))(p->base + dyn[DT_FINI]))();
+#endif
 	}
 }
 
@@ -723,8 +725,10 @@ static void do_init_fini(struct dso *p)
 			p->fini_next = fini_head;
 			fini_head = p;
 		}
+#ifndef NO_LEGACY_INITFINI
 		if (dyn[0] & (1<<DT_INIT))
 			((void (*)(void))(p->base + dyn[DT_INIT]))();
+#endif
 		if (dyn[0] & (1<<DT_INIT_ARRAY)) {
 			size_t n = dyn[DT_INIT_ARRAYSZ]/sizeof(size_t);
 			size_t *fn = (void *)(p->base + dyn[DT_INIT_ARRAY]);