mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: About those weak aliases
Date: Thu, 5 Sep 2019 19:29:04 +0200	[thread overview]
Message-ID: <20190905172904.GB9317@voyager> (raw)
In-Reply-To: <20190905165822.GA22009@port70.net>

On Thu, Sep 05, 2019 at 06:58:22PM +0200, Szabolcs Nagy wrote:
> can you show an example use of open in musl code
> where it is called form an api implementation
> that is defined by iso c?
>

No, I can't. And I think I understand now.

musl is trying to prevent linker errors from namespace pollution. More
specifically, to prevent double definition errors. Such an error would
happen during static linking, if a strong symbol from an unrelated
standard were pulled in. To that end, weak aliases are handed out on an
as-needed basis. open() is not needed to implement any interface from a
standard it is not a part of (fopen() inlines the syscall), so it gets
no alias. mmap() is needed to implement malloc(), so it gets one. Repeat
for all other functions.

How close am I?

Ciao,
Markus


  reply	other threads:[~2019-09-05 17:29 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
2019-09-05 16:50   ` Markus Wichmann
2019-09-05 16:58     ` Szabolcs Nagy
2019-09-05 17:29       ` Markus Wichmann [this message]
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=20190905172904.GB9317@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).