public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Andreas Schwab <schwab@suse.de>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [hurd,commited] hurd: Avoid more libc.so local PLTs
Date: Tue, 03 Apr 2018 22:30:00 -0000	[thread overview]
Message-ID: <20180403222954.zcniys5ujh4ryrvm@var.youpi.perso.aquilenet.fr> (raw)
In-Reply-To: <CAMe9rOrVkVJ+-gwcuE7pne5gnuhV1acTFZGWu_F4U-x+sowObQ@mail.gmail.com>

H.J. Lu, on mar. 03 avril 2018 15:21:33 -0700, wrote:
> On Tue, Apr 3, 2018 at 3:18 PM, Samuel Thibault
> <samuel.thibault@ens-lyon.org> wrote:
> > H.J. Lu, on mar. 03 avril 2018 15:14:16 -0700, wrote:
> >> On Tue, Apr 3, 2018 at 2:55 PM, Samuel Thibault
> >> <samuel.thibault@ens-lyon.org> wrote:
> >> > H.J. Lu, on mar. 03 avril 2018 14:41:27 -0700, wrote:
> >> >> On Tue, Apr 3, 2018 at 2:24 PM, Samuel Thibault
> >> >> <samuel.thibault@ens-lyon.org> wrote:
> >> >> > H.J. Lu, on mar. 03 avril 2018 14:16:50 -0700, wrote:
> >> >> >> On Tue, Apr 3, 2018 at 2:07 PM, Samuel Thibault
> >> >> >> <samuel.thibault@ens-lyon.org> wrote:
> >> >> >> > Hello,
> >> >> >> >
> >> >> >> > H.J. Lu, on mar. 03 avril 2018 12:26:33 -0700, wrote:
> >> >> >> >> __libc_longjmp and __libc_siglongjmp are private external functions provided for
> >> >> >> >> libpthread.  They should never be called inside libc.
> >> >> >> >
> >> >> >> > I'm sorry for asking, but are these conventions documented somewhere?
> >> >> >> > These look like magic to me otherwise:
> >> >> >>
> >> >> >> I don't believe they are well documented.
> >> >> >
> >> >> > Ok, then I need an answer to my question:
> >> >> >
> >> >> >> > why shouldn't they ever be called from libc?
> >> >> >
> >> >> > The existing hurd code does use them for catching signals, so I need to
> >> >> > know how to fix it.
> >> >>
> >> >> Use something similar to
> >> >>
> >> >> libc_hidden_proto (_setjmp)
> >> >> libc_hidden_proto (__sigsetjmp)
> >> >
> >> > So I'd just add hidden protos & defs to longjmp and siglongjmp?
> >> >
> >>
> >> setjmp/longjmp.c has
> >>
> >> weak_alias (__libc_siglongjmp, _longjmp)
> >> weak_alias (__libc_siglongjmp, longjmp)
> >>
> >> Will
> >>
> >> libc_hidden_proto (_longjmp)
> >>
> >> work for you?
> >
> > Well, _longjmp is the BSD version of longjmp with the semantic of
> > siglongjmp (actually it's _setjmp which makes the semantic different,
> > recorded in the jmp_buf). Here we do use longjmp, not _longjmp. Of
> > course, the end pointer is the same since it's _setjmp which makes
> > the semantic different, but I'd really rather not make the code more
> > confusing by using _longjmp while it is actually a longjmp which is
> > meant.
> 
> Aren't  the internal symbols of _longjmp, longjmp and siglongjmp
> pointing to the same __libc_siglongjmp function?

As I wrote above, yes.  But as I wrote above, writing _longjmp in some
source code which actually means longjmp would be very confusing (as
well as exposing a BSD symbol)

Samuel

  reply	other threads:[~2018-04-03 22:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03  0:38 Samuel Thibault
2018-04-03  8:10 ` Andreas Schwab
2018-04-03  8:20   ` Samuel Thibault
2018-04-03  9:02     ` Stefan Liebler
2018-04-03 19:26     ` H.J. Lu
2018-04-03 20:51       ` H.J. Lu
2018-04-03 21:08       ` Samuel Thibault
2018-04-03 21:16         ` H.J. Lu
2018-04-03 21:24           ` Samuel Thibault
2018-04-03 21:41             ` H.J. Lu
2018-04-03 21:55               ` Samuel Thibault
2018-04-03 22:14                 ` H.J. Lu
2018-04-03 22:18                   ` Samuel Thibault
2018-04-03 22:21                     ` H.J. Lu
2018-04-03 22:30                       ` Samuel Thibault [this message]
2018-04-03 22:21                 ` Zack Weinberg
2018-04-03 22:28                   ` Samuel Thibault
2018-04-03 22:33                     ` Zack Weinberg
2018-04-04  7:20                       ` Andreas Schwab
2018-04-03 22:39                   ` Samuel Thibault

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=20180403222954.zcniys5ujh4ryrvm@var.youpi.perso.aquilenet.fr \
    --to=samuel.thibault@ens-lyon.org \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /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).