mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Eleanor Bartle <eleanor@eleanor-nb.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] Care about Symbol Namespacing?
Date: Mon, 13 Nov 2023 22:10:26 -0500	[thread overview]
Message-ID: <20231114031026.GV4163@brightrain.aerifal.cx> (raw)
In-Reply-To: <946a873e-9c02-4cd2-9460-f6dfa3aa5028@app.fastmail.com>

On Tue, Nov 14, 2023 at 01:32:02PM +1100, Eleanor Bartle wrote:
> [please cc]
> 
> ELF doesn't have a standard equivalent of Mach-O's Two-Level
> Namespace, but one can be grafted on, as Solaris does with Direct
> Binding. I've inquired about this on IRC and the objections raised
> against it concern moving symbols between or coalescing shared
> objects without breaking dependent binaries. What I'm wondering is,
> is it worth thinking about a symbol namespacing system that accounts
> for this? Would the robustness benefits of such a system be worth
> the specification complexity?
> 
> To be clear, I don't have such a proposal on hand, and it would take
> me a while to get one ready (and a while more to work out all the
> kinks I'll inevitably miss); I have the ghost of an idea involving
> components specifying interface names rather than filenames, which
> ld.so could then map to shared objects potentially non-injectively,
> but I don't know the fine details of implementation. This message is
> mainly to gauge if leadership is at all interested in the broad
> idea, to determine if even thinking about it is worth my time.

The lack of this in ELF was by design, with the intent to give dynamic
linking semantics equivalent to static linking. This is also aligned
with the musl values of treating static linking as first-class (not
having functionality that doesn't work, or behaves wrong/differently,
in static-linked programs). I don't want to see something like this in
ELF, and it's not something I would support adding to musl even if
there were an ELF extension for it.

As you noted, there are also concrete things that would have been
impossible (? at least difficult, and contingent on details) to fix
with such a system, like glibc moving symbols that wrongly ended up in
librt.so or libpthread.so to libc.so.

Rich

  reply	other threads:[~2023-11-14  3:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14  2:32 Eleanor Bartle
2023-11-14  3:10 ` Rich Felker [this message]
2023-11-14  3:33   ` Eleanor Bartle
2023-11-14 15:35     ` Markus Wichmann
2023-11-15  6:11       ` Eleanor Bartle
2023-11-15 15:20         ` Rich Felker
2023-11-28  5:17           ` Fangrui Song
2023-11-29 13:45             ` Carlos O'Donell
2023-12-03 15:54               ` Fangrui Song

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=20231114031026.GV4163@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=eleanor@eleanor-nb.com \
    --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).