public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.vnet.ibm.com>
To: libc-alpha@sourceware.org
Cc: stli@linux.vnet.ibm.com, fweimer@redhat.com,
	murphyp@linux.vnet.ibm.com, schwab@linux-m68k.org,
	joseph_myers@mentor.com
Subject: [PATCH v3 9/9] Use libc_ifunc macro for siglongjmp, longjmp in libpthread.
Date: Wed, 24 Aug 2016 14:05:00 -0000	[thread overview]
Message-ID: <1472047472-30307-9-git-send-email-stli@linux.vnet.ibm.com> (raw)
In-Reply-To: <1472047472-30307-1-git-send-email-stli@linux.vnet.ibm.com>

This patch uses the libc_ifunc macro to create already existing ifunc functions
longjmp_ifunc, siglongjmp_ifunc if HAVE_IFUNC is defined.
The s390 pt-longjmp.c includes the common pt-longjmp.c and uses strong_alias
to create the longjmp, siglongjmp symbols for glibc version 2.19.

ChangeLog:

	* nptl/pt-longjmp.c (DEFINE_LONGJMP): Use libc_ifunc macro.
	* sysdeps/unix/sysv/linux/s390/pt-longjmp.c (longjmp, siglongjmp):
	Use strong_alias to create symbols for glibc verison 2.19.
---
 nptl/pt-longjmp.c                         | 24 ++++++------------------
 sysdeps/unix/sysv/linux/s390/pt-longjmp.c |  4 ++--
 2 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c
index a1cc286..a19cd59 100644
--- a/nptl/pt-longjmp.c
+++ b/nptl/pt-longjmp.c
@@ -32,24 +32,12 @@
 
 # if HAVE_IFUNC
 
-static __typeof (longjmp) *
-__attribute__ ((used))
-longjmp_resolve (void)
-{
-  return &__libc_longjmp;
-}
+#  undef INIT_ARCH
+#  define INIT_ARCH()
+#  define DEFINE_LONGJMP(name) libc_ifunc (name, &__libc_longjmp)
 
-#  ifdef HAVE_ASM_SET_DIRECTIVE
-#   define DEFINE_LONGJMP(name) \
-  asm (".set " #name ", longjmp_resolve\n" \
-       ".globl " #name "\n" \
-       ".type " #name ", %gnu_indirect_function");
-#  else
-#   define DEFINE_LONGJMP(name) \
-  asm (#name " = longjmp_resolve\n" \
-       ".globl " #name "\n" \
-       ".type " #name ", %gnu_indirect_function");
-#  endif
+extern __typeof(longjmp) longjmp_ifunc;
+extern __typeof(siglongjmp) siglongjmp_ifunc;
 
 # else  /* !HAVE_IFUNC */
 
@@ -66,7 +54,7 @@ longjmp_compat (jmp_buf env, int val)
 DEFINE_LONGJMP (longjmp_ifunc)
 compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0);
 
-DEFINE_LONGJMP (siglongjmp_ifunc)
+strong_alias (longjmp_ifunc, siglongjmp_ifunc)
 compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0);
 
 #endif
diff --git a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
index 10e825c..2abf112 100644
--- a/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
+++ b/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
@@ -26,8 +26,8 @@
 /* In glibc release 2.19 new versions of longjmp-functions were introduced,
    but were reverted before 2.20. Thus both versions are the same function.  */
 
-DEFINE_LONGJMP (__v2longjmp)
+strong_alias (longjmp_ifunc, __v2longjmp)
 compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19);
-DEFINE_LONGJMP (__v2siglongjmp)
+strong_alias (siglongjmp_ifunc, __v2siglongjmp)
 compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19);
 #endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20))  */
-- 
2.3.0

  parent reply	other threads:[~2016-08-24 14:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 14:05 [PATCH v3 1/9] Add configure check to test if gcc supports attribute ifunc Stefan Liebler
2016-08-24 14:05 ` [PATCH v3 3/9] s390: Refactor ifunc resolvers due to false debuginfo Stefan Liebler
2016-08-30 12:31   ` Florian Weimer
2016-08-30 14:12     ` Stefan Liebler
2016-08-24 14:05 ` [PATCH v3 2/9] Use gcc attribute ifunc in libc_ifunc macro instead of inline assembly " Stefan Liebler
2016-08-29 20:16   ` Paul E. Murphy
2016-08-30 14:12     ` Stefan Liebler
2016-09-29 18:38   ` Adhemerval Zanella
2016-09-30 13:45     ` Stefan Liebler
2016-10-04 13:14       ` Adhemerval Zanella
2016-08-24 14:05 ` Stefan Liebler [this message]
2016-10-06 11:59   ` [PATCH v3 9/9] Use libc_ifunc macro for siglongjmp, longjmp in libpthread Florian Weimer
2016-08-24 14:05 ` [PATCH v3 8/9] Use libc_ifunc macro for vfork " Stefan Liebler
2016-08-30 12:40   ` Florian Weimer
2016-08-24 14:05 ` [PATCH v3 6/9] Use libc_ifunc macro for clock_* symbols in librt Stefan Liebler
2016-08-30 12:39   ` Florian Weimer
2016-08-24 14:05 ` [PATCH v3 4/9] i386, x86: Use libc_ifunc macro for time, gettimeofday Stefan Liebler
2016-09-29 14:34   ` Andreas Schwab
2016-08-24 14:05 ` [PATCH v3 5/9] ppc: " Stefan Liebler
2016-08-30 13:46   ` Paul E. Murphy
2016-08-24 17:02 ` [PATCH v3 7/9] Use libc_ifunc macro for system in libpthread Stefan Liebler
2016-08-30 12:39   ` Florian Weimer
2016-08-29  9:34 ` [PATCH v3 1/9] Add configure check to test if gcc supports attribute ifunc Florian Weimer
2016-08-30 14:12   ` Stefan Liebler
2016-09-05  7:13 ` [PING][PATCH " Stefan Liebler
2016-09-29 13:50   ` Stefan Liebler
2016-10-07  9:19 ` [PATCH " Stefan Liebler

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=1472047472-30307-9-git-send-email-stli@linux.vnet.ibm.com \
    --to=stli@linux.vnet.ibm.com \
    --cc=fweimer@redhat.com \
    --cc=joseph_myers@mentor.com \
    --cc=libc-alpha@sourceware.org \
    --cc=murphyp@linux.vnet.ibm.com \
    --cc=schwab@linux-m68k.org \
    /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).