public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
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 20:51:00 -0000	[thread overview]
Message-ID: <CAMe9rOrM21f=VPZMN_M0BE38UHikVYes83+fxki=LAu1e=7OHg@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOoAeQbv6b-1hSTQ9b-EgiC5ErHO3UkS-aZFCFYLn7_xOQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2163 bytes --]

On Tue, Apr 3, 2018 at 12:26 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Apr 3, 2018 at 1:20 AM, Samuel Thibault
> <samuel.thibault@ens-lyon.org> wrote:
>> Andreas Schwab, on mar. 03 avril 2018 10:10:21 +0200, wrote:
>>> On Apr 03 2018, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
>>>
>>> >     * hurd/catch-signal.c (__hurd_catch_signal): Call __libc_siglongjmp
>>> >     instead if siglongjmp.
>>> >     (hurd_safe_memmove): Call __libc_longjmp instead of longjmp.
>>> >     * hurd/hurdfault.c (faulted): Call __libc_longjmp instead of longjmp.
>>> >     * include/setjmp.h (__libc_siglongjmp, __libc_longjmp): New hidden
>>> >     prototypes.
>>> >     * libio/iolibio.h (_IO_puts): New hidden prototype.
>>> >     * libio/ioputs.c (_IO_puts): New hidden def.
>>> >     * setjmp/longjmp.c (__libc_longjmp, __libc_siglongjmp): New hidden
>>> >     defs.
>>> >     * sysdeps/mach/hurd/sigwait.c (__sigwait): Call __libc_longjmp instead
>>> >     of longjmp.
>>>
>>> https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:glibc/glibc/s/s390x
>>>
>>> In file included from <command-line>:0:0:
>>> ../sysdeps/s390/longjmp.c:35:34: error: '__libc_longjmp' aliased to undefined symbol '__libc_siglongjmp'
>>>  strong_alias (__libc_siglongjmp, __libc_longjmp)
>>>                                   ^
>>> ./../include/libc-symbols.h:135:26: note: in definition of macro '_strong_alias'
>>>    extern __typeof (name) aliasname __attribute__ ((alias (#name)));
>>>                           ^~~~~~~~~
>>> ../sysdeps/s390/longjmp.c:35:1: note: in expansion of macro 'strong_alias'
>>>  strong_alias (__libc_siglongjmp, __libc_longjmp)
>>
>> Ah, there is #define __libc_siglongjmp magic here indeed.  Does the
>> attached patch fix it?
>
> __libc_longjmp and __libc_siglongjmp are private external functions provided for
> libpthread.  They should never be called inside libc.   Please revert
> it and find another
> way to fix hurd.

Here is my patch:

https://sourceware.org/git/?p=glibc.git;a=commit;h=6253bacdc00de132dec452ff7c6ce3ba7fa23d81

which removed

libc_hidden_def (__libc_longjmp)

I am going to check in this path.


-- 
H.J.

[-- Attachment #2: 0001-Revert-hurd-Avoid-more-libc.so-local-PLTs.patch --]
[-- Type: text/x-patch, Size: 4126 bytes --]

From c8325751c171e358881db27628059b4970db3649 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 3 Apr 2018 13:45:26 -0700
Subject: [PATCH] Revert "hurd: Avoid more libc.so local PLTs"

This reverts commit 811836a411a1c97a0e70e7f096e57f316dc19c72 and
commit 82dbf555a4d41690f63b94ccb4db4bf43d873aa0:

	* hurd/catch-signal.c (__hurd_catch_signal): Call __libc_siglongjmp
	instead if siglongjmp.
	(hurd_safe_memmove): Call __libc_longjmp instead of longjmp.
	* hurd/hurdfault.c (faulted): Call __libc_longjmp instead of longjmp.
	* include/setjmp.h (__libc_siglongjmp, __libc_longjmp): New hidden
	prototypes.
	* setjmp/longjmp.c (__libc_longjmp, __libc_siglongjmp): New hidden
	defs.
	* sysdeps/mach/hurd/sigwait.c (__sigwait): Call __libc_longjmp instead
	of longjmp.
	* sysdeps/s390/longjmp.c (__libc_longjmp, __libc_siglongjmp): New
	hidden defs.
---
 hurd/catch-signal.c         | 4 ++--
 hurd/hurdfault.c            | 2 +-
 include/setjmp.h            | 3 ---
 setjmp/longjmp.c            | 2 --
 sysdeps/mach/hurd/sigwait.c | 2 +-
 sysdeps/s390/longjmp.c      | 2 --
 6 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/hurd/catch-signal.c b/hurd/catch-signal.c
index a00ccef4fb..56ce86532d 100644
--- a/hurd/catch-signal.c
+++ b/hurd/catch-signal.c
@@ -32,7 +32,7 @@ __hurd_catch_signal (sigset_t sigset,
      instance calling hurd_catch_signal again would then dump core.  */
   sigjmp_buf buf;
   void throw (int signo, long int sigcode, struct sigcontext *scp)
-    { __libc_siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); }
+    { siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); }
 
   struct hurd_signal_preemptor preemptor =
     {
@@ -121,7 +121,7 @@ hurd_safe_memmove (void *dest, const void *src, size_t nbytes)
 {
   jmp_buf buf;
   void throw (int signo, long int sigcode, struct sigcontext *scp)
-    { __libc_longjmp (buf, scp->sc_error ?: EGRATUITOUS); }
+    { longjmp (buf, scp->sc_error ?: EGRATUITOUS); }
 
   struct hurd_signal_preemptor src_preemptor =
     {
diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c
index c42d5e739a..39a4522811 100644
--- a/hurd/hurdfault.c
+++ b/hurd/hurdfault.c
@@ -152,7 +152,7 @@ faulted (void)
     __libc_fatal ("BUG: unexpected fault in signal thread\n");
 
   _hurdsig_fault_preemptor.signals = 0;
-  __libc_longjmp (_hurdsig_fault_env, 1);
+  longjmp (_hurdsig_fault_env, 1);
 }
 
 static char faultstack[1024];
diff --git a/include/setjmp.h b/include/setjmp.h
index 682ff4b5a5..263bc64b3d 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -24,9 +24,6 @@ extern void __libc_siglongjmp (sigjmp_buf env, int val)
 extern void __libc_longjmp (sigjmp_buf env, int val)
      __attribute__ ((noreturn));
 
-libc_hidden_proto (__libc_siglongjmp)
-libc_hidden_proto (__libc_longjmp)
-
 libc_hidden_proto (_setjmp)
 libc_hidden_proto (__sigsetjmp)
 
diff --git a/setjmp/longjmp.c b/setjmp/longjmp.c
index 0555d6d6b7..a2a7065a85 100644
--- a/setjmp/longjmp.c
+++ b/setjmp/longjmp.c
@@ -46,6 +46,4 @@ strong_alias (__libc_siglongjmp, __libc_longjmp)
 weak_alias (__libc_siglongjmp, _longjmp)
 weak_alias (__libc_siglongjmp, longjmp)
 weak_alias (__libc_siglongjmp, siglongjmp)
-libc_hidden_def (__libc_longjmp)
-libc_hidden_def (__libc_siglongjmp)
 #endif
diff --git a/sysdeps/mach/hurd/sigwait.c b/sysdeps/mach/hurd/sigwait.c
index 321ab46d14..ce17cce895 100644
--- a/sysdeps/mach/hurd/sigwait.c
+++ b/sysdeps/mach/hurd/sigwait.c
@@ -59,7 +59,7 @@ __sigwait (const sigset_t *set, int *sig)
     handler (int sig)
     {
       assert (sig == signo);
-      __libc_longjmp (buf, 1);
+      longjmp (buf, 1);
     }
 
   wait = __mach_reply_port ();
diff --git a/sysdeps/s390/longjmp.c b/sysdeps/s390/longjmp.c
index e543415df0..e61cdba2a3 100644
--- a/sysdeps/s390/longjmp.c
+++ b/sysdeps/s390/longjmp.c
@@ -33,8 +33,6 @@
    but were reverted before 2.20. Thus both versions are the same function.  */
 
 strong_alias (__libc_siglongjmp, __libc_longjmp)
-libc_hidden_def (__libc_longjmp)
-libc_hidden_def (__libc_siglongjmp)
 
 weak_alias (__libc_siglongjmp, __v1_longjmp)
 weak_alias (__libc_siglongjmp, __v2_longjmp)
-- 
2.14.3


  reply	other threads:[~2018-04-03 20:51 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 [this message]
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
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='CAMe9rOrM21f=VPZMN_M0BE38UHikVYes83+fxki=LAu1e=7OHg@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=samuel.thibault@ens-lyon.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).