public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Szabolcs Nagy <nsz@port70.net>
Cc: "H.J. Lu" <hjl.tools@gmail.com>, Alan Modra <amodra@gmail.com>,
	 gnu-gabi@sourceware.org
Subject: Re: Specify how undefined weak symbol should be resolved in executable
Date: Fri, 01 Jan 2016 00:00:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.20.1602231716470.20277@wotan.suse.de> (raw)
In-Reply-To: <20160223154437.GA29662@port70.net>

Hi,

On Tue, 23 Feb 2016, Szabolcs Nagy wrote:

> libgcc/gthr-posix.h checks 'multi-threadedness' by looking
> at a weakref (if it's zero then single-threaded execution
> is assumed).
> 
> on glibc the weakref is __pthread_key_create nowadays,
> but on other systems or older libgcc it's pthread_cancel.

Yep, that's the one.

> so the address of this weakref is taken, the other pthread weakrefs are 
> called only if this weakref was non-zero.
> 
> i'm not sure how the proposed changes affect this use-case,

Some of the variants will make this use-case work also for non-PIC
executables, at the expense of one more unsharable .text page on some 
architectures (the one where this adress-checking takes place).

> but this way of deciding single-threadedness is broken and a bug that 
> gcc should eventually fix.  (e.g. a static linked multi-threaded c++ 
> application may not have a pthread_cancel symbol defined and thus 
> libstdc++ may not use locks where necessary or crash when pthread_cancel 
> is defined but other weakrefs are not).

Yep, that's one problem of our current behaviour with addresses of weak 
symbols on non-PIC.


Ciao,
Michael.

  reply	other threads:[~2016-02-23 16:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01  0:00 H.J. Lu
2016-01-01  0:00 ` H.J. Lu
2016-01-01  0:00   ` Michael Matz
2016-01-01  0:00     ` H.J. Lu
2016-01-01  0:00       ` Michael Matz
2016-01-01  0:00         ` H.J. Lu
2016-01-01  0:00           ` H.J. Lu
2016-01-01  0:00             ` H.J. Lu
2016-01-01  0:00               ` H.J. Lu
2016-01-01  0:00             ` Alan Modra
2016-01-01  0:00               ` H.J. Lu
2016-01-01  0:00                 ` Michael Matz
2016-01-01  0:00                   ` H.J. Lu
2016-01-01  0:00                     ` Michael Matz
2016-01-01  0:00                       ` Szabolcs Nagy
2016-01-01  0:00                         ` Michael Matz [this message]
2016-01-01  0:00               ` H.J. Lu
2016-01-01  0:00                 ` Michael Matz
2016-01-01  0:00                   ` H.J. Lu
2016-01-01  0:00                     ` Michael Matz
2016-01-01  0:00                       ` H.J. Lu
2016-01-01  0:00                         ` H.J. Lu
2016-01-01  0:00                         ` Alan Modra
2016-01-01  0:00                           ` H.J. Lu
2016-01-01  0:00                             ` Alan Modra
2016-01-01  0:00                               ` Carlos O'Donell
2016-01-01  0:00                                 ` H.J. Lu
2016-01-01  0:00                                   ` Michael Matz
2016-01-01  0:00                                     ` H.J. Lu
2016-01-01  0:00                                       ` Michael Matz
2016-01-01  0:00                                         ` H.J. Lu
2016-01-01  0:00                                           ` Michael Matz
2016-01-01  0:00                                             ` H.J. Lu
2016-01-01  0:00   ` H.J. Lu

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=alpine.LSU.2.20.1602231716470.20277@wotan.suse.de \
    --to=matz@suse.de \
    --cc=amodra@gmail.com \
    --cc=gnu-gabi@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=nsz@port70.net \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).