public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fweimer at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug dynamic-link/28248] is there a way to LD_PRELOAD library before other dynamic libraries?
Date: Mon, 06 Sep 2021 08:32:48 +0000	[thread overview]
Message-ID: <bug-28248-131-wjQ1xZEEfF@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28248-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28248

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Milian Wolff from comment #2)
> I see, thank you!
> 
> Is there an alternative mechanism - potentially low-level / undocumented -
> that I could leverage to somehow inject my interposing library in such a
> way, that it's initialization happens after libc, but before any other
> libraries?

For glibc 2.34 on Linux, linking with -Wl,-z,initfirst should work. glibc
should no longer use DF_1_INITFIRST itself, so it's available for application
use.

> That way, I can call `__libc_freeres` safely, as no other library code run -
> except that of libc itself.

So this is about destructors? glibc currently does not guarantee that
destructors run in the opposite order of constructors (even without dlclose,
which can make some reordering necessary due to early unloading).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-09-06  8:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 12:57 [Bug dynamic-link/28248] New: " mail at milianw dot de
2021-08-31 17:41 ` [Bug dynamic-link/28248] " amonakov at gmail dot com
2021-09-06  8:19 ` mail at milianw dot de
2021-09-06  8:32 ` fweimer at redhat dot com [this message]
2021-09-09  8:35 ` mail at milianw dot de
2021-09-09  8:54 ` mail at milianw dot de
2022-08-29  9:53 ` fweimer at redhat dot com

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=bug-28248-131-wjQ1xZEEfF@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).