arrfab / rpms / glibc

Forked from rpms/glibc 4 years ago
Clone

Blame SOURCES/glibc-rh1527904-4.patch

147e83
commit 08c6e95234c60a5c2f37532d1111acf084f39345
147e83
Author: Florian Weimer <fweimer@redhat.com>
147e83
Date:   Thu Jan 11 13:13:28 2018 +0100
147e83
147e83
    csu: Update __libgcc_s_init comment
147e83
    
147e83
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
147e83
147e83
commit f993b8754080ac7572b692870e926d8b493db16c
147e83
Author: Florian Weimer <fweimer@redhat.com>
147e83
Date:   Wed Jan 10 13:18:04 2018 +0100
147e83
147e83
    nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636]
147e83
    
147e83
    Disabling lazy binding reduces stack usage during unwinding.
147e83
    
147e83
    Note that RTLD_NOW only makes a difference if libgcc.so has not
147e83
    already been loaded, so this is only a partial fix.
147e83
    
147e83
    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
147e83
147e83
Index: glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c
147e83
===================================================================
147e83
--- glibc-2.17-c758a686.orig/nptl/sysdeps/pthread/unwind-forcedunwind.c
147e83
+++ glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c
147e83
@@ -51,7 +51,7 @@ pthread_cancel_init (void)
147e83
       return;
147e83
     }
147e83
 
147e83
-  handle = __libc_dlopen (LIBGCC_S_SO);
147e83
+  handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
147e83
 
147e83
   if (handle == NULL
147e83
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
147e83
Index: glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c
147e83
===================================================================
147e83
--- glibc-2.17-c758a686.orig/sysdeps/gnu/unwind-resume.c
147e83
+++ glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c
147e83
@@ -35,12 +35,17 @@ init (void)
147e83
   void *resume, *personality;
147e83
   void *handle;
147e83
 
147e83
-  handle = __libc_dlopen (LIBGCC_S_SO);
147e83
+  /* Use RTLD_NOW here for consistency with pthread_cancel_init.
147e83
+     RTLD_NOW will rarely make a difference here because unwinding is
147e83
+     already in progress, so libgcc_s.so has already been loaded if
147e83
+     its unwinder is used.  */
147e83
+  handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
147e83
 
147e83
   if (handle == NULL
147e83
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
147e83
       || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
147e83
-    __libc_fatal (LIBGCC_S_SO " must be installed for pthread_cancel to work\n");
147e83
+    __libc_fatal (LIBGCC_S_SO
147e83
+		  " must be installed for unwinding to work\n");
147e83
 
147e83
   libgcc_s_resume = resume;
147e83
   libgcc_s_personality = personality;