mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: pthread_key_create bug?
Date: Tue, 8 Jan 2019 23:10:06 +0100	[thread overview]
Message-ID: <20190108221006.GF29911@voyager> (raw)
In-Reply-To: <20190108000018.GZ23599@brightrain.aerifal.cx>

On Mon, Jan 07, 2019 at 07:00:18PM -0500, Rich Felker wrote:
> I think you're right, though we don't generally use weak references in
> musl on the basis (perhaps somewhat dubious) that they're an
> additional toolchain feature that might cause problems reusing the
> code in non-ELF contexts (this may affect midipix; I'm not sure).
> That's why weak aliases to dummy functions are used for this purpose
> everywhere else.
> 

I don't quite get you. Weak aliases are just weak references with a
non-zero default value. Any toolchain being able to handle weak aliases
should be able to handle weak references, right?

And if a port had to fudge things to get weak aliases to work, they
could just continue to fudge things to make weak references into strong
ones. This is merely an optimization; not having the weak reference
doesn't break anything, just increases the binary size.

> Also: weak references to hidden functions historically had some
> breakage with respect to generating unresolvable-at-ld-time
> pc-relative references to the symbol. Thus their use might break some
> gcc/binutils versions too.
> 
> Rich

OK, that's interesting. But do we really want to work around bugs in
gcc/binutils? Especially ones that were fixed a while ago? Because that
might lead us to a situation where we have ugly code we can't improve
because an old version of binutils had a bug, which is a fact that will
never go away, so the code stays ugly forever.

Not saying this is that situation, of course.

Ciao,
Markus


  parent reply	other threads:[~2019-01-08 22:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-06 14:35 Nathaniel Pierce
2019-01-06 14:50 ` A. Wilcox
2019-01-06 16:28   ` Szabolcs Nagy
2019-01-07  2:11   ` Rich Felker
2019-01-07 12:24     ` A. Wilcox
2019-01-07 14:12       ` Rich Felker
2019-01-07 17:13     ` Markus Wichmann
2019-01-08  0:00       ` Rich Felker
2019-01-08  8:43         ` u-uy74
2019-01-08 19:34           ` Markus Wichmann
2019-01-08 22:40             ` writeonce
2019-01-08 22:10         ` Markus Wichmann [this message]
2019-01-08 23:07           ` A. Wilcox
2019-01-09  0:29           ` Rich Felker
2019-01-09 11:45             ` Szabolcs Nagy

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=20190108221006.GF29911@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).