Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* elf/dl-fini.c (_dl_fini): Invoke fini_array in _reverse_ order.
	Don't add L->l_addr to array entry values.
  • Loading branch information
Roland McGrath committed Nov 7, 2002
1 parent 58ef9ef commit 1d8a0fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2002-10-28 David Mosberger <davidm@hpl.hp.com>

* elf/dl-fini.c (_dl_fini): Invoke fini_array in _reverse_ order.
Don't add L->l_addr to array entry values.

2002-11-07 Jakub Jelinek <jakub@redhat.com>

* string/test-string.h: New file.
Expand Down
10 changes: 4 additions & 6 deletions elf/dl-fini.c
Expand Up @@ -157,12 +157,10 @@ _dl_fini (void)
ElfW(Addr) *array =
(ElfW(Addr) *) (l->l_addr
+ l->l_info[DT_FINI_ARRAY]->d_un.d_ptr);
unsigned int sz = (l->l_info[DT_FINI_ARRAYSZ]->d_un.d_val
/ sizeof (ElfW(Addr)));
unsigned int cnt;

for (cnt = 0; cnt < sz; ++cnt)
((fini_t) (l->l_addr + array[cnt])) ();
unsigned int i = (l->l_info[DT_FINI_ARRAYSZ]->d_un.d_val
/ sizeof (ElfW(Addr)));
while (i-- > 0)
((fini_t) array[i]) ();
}

/* Next try the old-style destructor. */
Expand Down

0 comments on commit 1d8a0fd

Please sign in to comment.