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<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<base + dyn[DT_FINI]))();