From: Rich Felker Date: Sun, 21 Jul 2013 06:35:46 +0000 (-0400) Subject: fix order of fini_array execution for shared libs X-Git-Tag: v0.9.12~52 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1b413572b271ebb93af38d73fa57eb85175e8a50;p=oweals%2Fmusl.git fix order of fini_array execution for shared libs --- 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]))();