public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 0/3] Fine-tune ELF destructor ordering (bug 30869)
Date: Tue, 19 Sep 2023 10:48:09 +0200	[thread overview]
Message-ID: <cover.1695113064.git.fweimer@redhat.com> (raw)

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


             reply	other threads:[~2023-09-19  8:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  8:48 Florian Weimer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1695113064.git.fweimer@redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).