mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: [musl] Cannot dlopen() an already loaded shared library by its SONAME name
Date: Tue, 11 Jan 2022 18:55:41 +0100	[thread overview]
Message-ID: <20220111175541.GB2046@voyager> (raw)
In-Reply-To: <CAMmqxguXGa2cswmRgVLnX=-4CvA8uRzRmfgXjNdTp73CrBXvrQ@mail.gmail.com>

On Tue, Jan 11, 2022 at 12:50:33PM +0100, Ilia K wrote:
> Hi!
>
> It turns out that `dlopen()` in musl cannot find the already loaded shared
> library using the library soname from the dynamic section, unlike glibc.
> [...]
> Do you have any plans to support it?
>

Given that this question already surfaced twice and was denied just as
often, I'm guessing no.

The reason for the behavior is that loading a library with explicit path
name is what you do with a plugin, and you don't necessarily want a
plugin's symbols to be visible to everyone. That's why a library loaded
by path name does not get a shortname set, and a shortname is what you
need to be able to find a library by just its name.

I would suggest always loading the library by its short name and setting
LD_LIBRARY_PATH if this is what you want. That behavior works
consistently across all libc implementations I know.

Ciao,
Markus

  reply	other threads:[~2022-01-11 17:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 11:50 Ilia K
2022-01-11 17:55 ` Markus Wichmann [this message]
2022-01-11 21:30   ` Harmen Stoppels
2022-01-11 22:22     ` Rich Felker
2022-01-12 14:52       ` Harmen Stoppels
2022-01-12 16:58         ` Farid Zakaria

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=20220111175541.GB2046@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).