about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 dbf404ef..829696ff 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -698,8 +698,8 @@ static void do_fini()
 		decode_vec(p->dynv, dyn, DYN_CNT);
 		if (dyn[0] & (1<<DT_FINI_ARRAY)) {
 			size_t n = dyn[DT_FINI_ARRAYSZ]/sizeof(size_t);
-			size_t *fn = (void *)(p->base + dyn[DT_FINI_ARRAY]);
-			while (n--) ((void (*)(void))*fn++)();
+			size_t *fn = (size_t *)(p->base + dyn[DT_FINI_ARRAY])+n;
+			while (n--) ((void (*)(void))*--fn)();
 		}
 		if (dyn[0] & (1<<DT_FINI))
 			((void (*)(void))(p->base + dyn[DT_FINI]))();