diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-07-21 02:35:46 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-07-21 02:35:46 -0400 |
commit | 1b413572b271ebb93af38d73fa57eb85175e8a50 (patch) | |
tree | 429da7bf44fb09321d08ce238b2d83145d7a7d5f /src/ldso | |
parent | e69ae844dcc978f68761e4bc44fc5543717b9684 (diff) | |
download | musl-1b413572b271ebb93af38d73fa57eb85175e8a50.tar.gz musl-1b413572b271ebb93af38d73fa57eb85175e8a50.tar.bz2 musl-1b413572b271ebb93af38d73fa57eb85175e8a50.tar.xz musl-1b413572b271ebb93af38d73fa57eb85175e8a50.zip |
fix order of fini_array execution for shared libs
Diffstat (limited to 'src/ldso')
-rw-r--r-- | src/ldso/dynlink.c | 4 |
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]))(); |