public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mail at milianw dot de" <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: Thu, 09 Sep 2021 08:54:20 +0000 [thread overview] Message-ID: <bug-28248-131-yXwmdSqkTy@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-28248-131@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=28248 --- Comment #5 from Milian Wolff <mail at milianw dot de> --- I just tried the linker flag with the example given above, but sadly it doesn't help as only the `calling init` is changed, but `calling fini` isn't - this was probably what you had in mind when you raised the potential issue about constructor/destructor order. ``` $ gcc -shared -fPIC -o preload_dump.so preload_dump.c LD_DEBUG=files LD_PRELOAD=$PWD/preload_dump.so bash --version |& grep -i calling 7413: calling init: /lib64/ld-linux-x86-64.so.2 7413: calling init: /usr/lib/libc.so.6 7413: calling init: /usr/lib/libncursesw.so.6 7413: calling init: /usr/lib/libdl.so.2 7413: calling init: /usr/lib/libreadline.so.8 7413: calling init: /tmp/preload_dump.so 7413: calling fini: bash [0] 7413: calling fini: /tmp/preload_dump.so [0] 7413: calling fini: /usr/lib/libreadline.so.8 [0] 7413: calling fini: /usr/lib/libdl.so.2 [0] 7413: calling fini: /usr/lib/libncursesw.so.6 [0] $ gcc -shared -fPIC -Wl,-z,initfirst -o preload_dump.so preload_dump.c $ LD_DEBUG=files LD_PRELOAD=$PWD/preload_dump.so bash --version |& grep -i calling 7373: calling init: /tmp/preload_dump.so 7373: calling init: /lib64/ld-linux-x86-64.so.2 7373: calling init: /usr/lib/libc.so.6 7373: calling init: /usr/lib/libncursesw.so.6 7373: calling init: /usr/lib/libdl.so.2 7373: calling init: /usr/lib/libreadline.so.8 7373: calling fini: bash [0] 7373: calling fini: /tmp/preload_dump.so [0] 7373: calling fini: /usr/lib/libreadline.so.8 [0] 7373: calling fini: /usr/lib/libdl.so.2 [0] 7373: calling fini: /usr/lib/libncursesw.so.6 [0] ``` Too bad! That would seem to indicate that I'm out of luck here and must stop calling `__libc_freeres` - or does someone have an alternative suggestion I could employ? -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2021-09-09 8:54 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 2021-09-09 8:35 ` mail at milianw dot de 2021-09-09 8:54 ` mail at milianw dot de [this message] 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-yXwmdSqkTy@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: linkBe 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).