From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 85593385801E; Mon, 6 Sep 2021 08:19:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85593385801E From: "mail at milianw dot de" 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:19:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.33 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mail at milianw dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 08:19:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28248 --- Comment #2 from Milian Wolff --- 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, th= at it's initialization happens after libc, but before any other libraries? I.e. instead of this: ``` 83: calling init: /lib64/libc.so.6 83: 83: 83: calling init: /lib64/libdl.so.2 83: 83: 83: calling init: /lib64/libtinfo.so.5 83: 83: 83: calling init: /opt/craft/preload_dump.so ``` I would like to somehow achieve this: ``` 83: calling init: /lib64/libc.so.6 83: 83: 83: calling init: /opt/craft/preload_dump.so 83: 83: 83: calling init: /lib64/libdl.so.2 83: 83: 83: calling init: /lib64/libtinfo.so.5 ``` That way, I can call `__libc_freeres` safely, as no other library code run - except that of libc itself. Thanks --=20 You are receiving this mail because: You are on the CC list for the bug.=