mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: About those weak aliases
Date: Tue, 3 Sep 2019 08:08:55 -0400	[thread overview]
Message-ID: <20190903120855.GW9017@brightrain.aerifal.cx> (raw)
In-Reply-To: <20190903101339.GX22009@port70.net>

On Tue, Sep 03, 2019 at 12:13:39PM +0200, Szabolcs Nagy wrote:
> * Rich Felker <dalias@libc.org> [2019-09-02 19:01:18 -0400]:
> > On Mon, Sep 02, 2019 at 10:10:10PM +0200, Szabolcs Nagy wrote:
> > > (could be a strong alias, weakness of public api symbols
> > > doesn't matter, you can only observe the difference by
> > > getting a link error when static linking a conflicting
> > > definition, but that is non-standard: when the symbol is
> > > reserved for the implementation user code must not use it)
> > 
> > I don't follow here. There are very few if any places where strong
> > alias would be a valid substitute for weak. Where weak aliases provide
> > dummy implementations of functionality that's only needed if something
> > else is linked, strong would be a link error if both were linked.
> > Where weak aliases are used because the identifier being defined is
> > reserved to the application in some or all standard profiles, a strong
> > alias would produce a link error if the application actually made use
> > of its reservation and the file defining the alias got linked (and the
> > whole point is that this can and does happen).
> 
> you are right. sorry

No problem. It's informative for uncovering if there are such cases
and what they're for.

I think the only places strong aliases would be okay is when the alias
is providing a public interface and it's in the same namespace (or a
more restrictive implementation namespace) as the symbol it's
aliasing. These are mostly glibc ABI-compat symbols where the glibc
ABI had __-prefixed versions of some public function as a public ABI
(e.g. the __-prefixed versions of the 'xlocale' functions,
__isoc99_*scanf, __getdelim; maybe nothing else).

Rich


  reply	other threads:[~2019-09-03 12:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 19:04 Markus Wichmann
2019-09-02 20:10 ` Szabolcs Nagy
2019-09-02 23:01   ` Rich Felker
2019-09-03 10:13     ` Szabolcs Nagy
2019-09-03 12:08       ` Rich Felker [this message]
2019-09-05 16:50   ` Markus Wichmann
2019-09-05 16:58     ` Szabolcs Nagy
2019-09-05 17:29       ` Markus Wichmann
2019-09-05 18:18         ` Rich Felker

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=20190903120855.GW9017@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).