mirror of
git://git.musl-libc.org/musl
synced 2024-12-21 22:30:09 +00:00
fix order of fini_array execution for shared libs
This commit is contained in:
parent
e69ae844dc
commit
1b413572b2
@ -698,8 +698,8 @@ static void do_fini()
|
|||||||
decode_vec(p->dynv, dyn, DYN_CNT);
|
decode_vec(p->dynv, dyn, DYN_CNT);
|
||||||
if (dyn[0] & (1<<DT_FINI_ARRAY)) {
|
if (dyn[0] & (1<<DT_FINI_ARRAY)) {
|
||||||
size_t n = dyn[DT_FINI_ARRAYSZ]/sizeof(size_t);
|
size_t n = dyn[DT_FINI_ARRAYSZ]/sizeof(size_t);
|
||||||
size_t *fn = (void *)(p->base + dyn[DT_FINI_ARRAY]);
|
size_t *fn = (size_t *)(p->base + dyn[DT_FINI_ARRAY])+n;
|
||||||
while (n--) ((void (*)(void))*fn++)();
|
while (n--) ((void (*)(void))*--fn)();
|
||||||
}
|
}
|
||||||
if (dyn[0] & (1<<DT_FINI))
|
if (dyn[0] & (1<<DT_FINI))
|
||||||
((void (*)(void))(p->base + dyn[DT_FINI]))();
|
((void (*)(void))(p->base + dyn[DT_FINI]))();
|
||||||
|
Loading…
Reference in New Issue
Block a user