public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fine-tune ELF destructor ordering (bug 30869)
@ 2023-09-19  8:48 Florian Weimer
  2023-09-19  8:48 ` [PATCH 1/3] elf: Record main program constructor/destructor in ordering tests Florian Weimer
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Florian Weimer @ 2023-09-19  8:48 UTC (permalink / raw)
  To: libc-alpha

It turns out that we cannot simply reverse the constructor ordering.
Some applications expect that the main program is destructed first.
It also seems reasonable to assume that some applications depend
on the destructor ordering resulting from explicit dlclose calls
upon exit time (destructors calling dlclose).

The change in main program destructor ordering went unnoticed because
the DSO ordering test framework did not record main program
constructor/destructor calls, so the first commit fixes that omission.

Thanks,
Florian

Florian Weimer (3):
  elf: Record main program constructor/destructor in ordering tests
  elf: Add dummy declaration of _dl_audit_objclose for !SHARED
  elf: Process initially loaded objects first in _dl_fini (bug 30869)

 elf/Makefile                 | 21 +++++++++++++
 elf/dl-fini.c                | 49 ++++++++++++++++++++---------
 elf/dl-init.c                | 38 ++++++++++++++++------
 elf/dso-sort-tests-1.def     | 24 +++++++-------
 elf/dso-sort-tests-2.def     |  4 +--
 elf/tst-finiorder1.c         | 52 ++++++++++++++++++++++++++++++
 elf/tst-finiorder1mod1.c     | 43 +++++++++++++++++++++++++
 elf/tst-finiorder1mod2.c     | 36 +++++++++++++++++++++
 elf/tst-finiorder2.c         | 61 ++++++++++++++++++++++++++++++++++++
 elf/tst-finiorder2mod1.c     | 49 +++++++++++++++++++++++++++++
 elf/tst-finiorder2mod2.c     | 35 +++++++++++++++++++++
 elf/tst-finiorder2mod3.c     | 36 +++++++++++++++++++++
 scripts/dso-ordering-test.py | 32 ++++++++++++-------
 sysdeps/generic/ldsodefs.h   | 12 ++++++-
 14 files changed, 441 insertions(+), 51 deletions(-)
 create mode 100644 elf/tst-finiorder1.c
 create mode 100644 elf/tst-finiorder1mod1.c
 create mode 100644 elf/tst-finiorder1mod2.c
 create mode 100644 elf/tst-finiorder2.c
 create mode 100644 elf/tst-finiorder2mod1.c
 create mode 100644 elf/tst-finiorder2mod2.c
 create mode 100644 elf/tst-finiorder2mod3.c


base-commit: 5bc9b3a1f6a003f6456f717b590615ea98e2d6fb
-- 
2.41.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-10-06 12:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-19  8:48 [PATCH 0/3] Fine-tune ELF destructor ordering (bug 30869) Florian Weimer
2023-09-19  8:48 ` [PATCH 1/3] elf: Record main program constructor/destructor in ordering tests Florian Weimer
2023-09-19  8:56   ` Andreas Schwab
2023-09-19  9:30     ` Florian Weimer
2023-09-19 12:41   ` Carlos O'Donell
2023-09-19 12:47     ` Florian Weimer
2023-09-19 14:24       ` Carlos O'Donell
2023-09-19 14:41         ` Florian Weimer
2023-09-19  8:48 ` [PATCH 2/3] elf: Add dummy declaration of _dl_audit_objclose for !SHARED Florian Weimer
2023-09-19 12:43   ` Carlos O'Donell
2023-09-19  8:48 ` [PATCH 3/3] elf: Process initially loaded objects first in _dl_fini (bug 30869) Florian Weimer
2023-10-06 12:35 ` [PATCH 0/3] Fine-tune ELF destructor ordering " Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).