Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190905172904.GB9317@voyager>
Date: Thu, 5 Sep 2019 19:29:04 +0200
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: About those weak aliases

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.