about summary refs log tree commit diff
path: root/nptl/pt-system.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2017-08-08 16:21:58 +0200
committerAndreas Schwab <schwab@suse.de>2017-08-08 17:01:25 +0200
commitfc5ad7024c620cdfe9b76e94638aac83b99c5bf8 (patch)
tree929df32f5ce97b2cf61b3c7622f736033e86429b /nptl/pt-system.c
parent852d63120783fae5bf85a067320dc4ba1ed59f11 (diff)
downloadglibc-fc5ad7024c620cdfe9b76e94638aac83b99c5bf8.tar.gz
glibc-fc5ad7024c620cdfe9b76e94638aac83b99c5bf8.tar.xz
glibc-fc5ad7024c620cdfe9b76e94638aac83b99c5bf8.zip
Don't use IFUNC resolver for longjmp or system in libpthread (bug 21041)
Unlike the vfork forwarder and like the fork forwarder as in bug 19861,
there won't be a problem when the compiler does not turn this into a tail
call.
Diffstat (limited to 'nptl/pt-system.c')
-rw-r--r--nptl/pt-system.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/nptl/pt-system.c b/nptl/pt-system.c
index f8ca6ba0d9..b30ddf2b39 100644
--- a/nptl/pt-system.c
+++ b/nptl/pt-system.c
@@ -25,29 +25,21 @@
    libpthread, but the historical ABI requires it.  For static linking,
    there is no need to provide anything here--the libc version will be
    linked in.  For shared library ABI compatibility, there must be a
-   'system' symbol in libpthread.so; so we define it using IFUNC to
-   redirect to the libc function.  */
+   'system' symbol in libpthread.so.
 
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-
-# if HAVE_IFUNC
-
-extern __typeof(system) system_ifunc;
-#  undef INIT_ARCH
-#  define INIT_ARCH()
-libc_ifunc (system_ifunc, &__libc_system)
+   With an IFUNC resolver, it would be possible to avoid the indirection,
+   but the IFUNC resolver might run before the __libc_system symbol has
+   been relocated, in which case the IFUNC resolver would not be able to
+   provide the correct address.  */
 
-# else  /* !HAVE_IFUNC */
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
 
 static int __attribute__ ((used))
 system_compat (const char *line)
 {
   return __libc_system (line);
 }
-strong_alias (system_compat, system_ifunc)
-
-# endif  /* HAVE_IFUNC */
-
-compat_symbol (libpthread, system_ifunc, system, GLIBC_2_0);
+strong_alias (system_compat, system_alias)
+compat_symbol (libpthread, system_alias, system, GLIBC_2_0);
 
 #endif