This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel


On 01/10/2018 08:29 PM, Carlos O'Donell wrote:

What I want to avoid is two similar pieces of code that do distinct
things. Is there any reason we shouldn't just checkin a change here
that makes both the same, thus avoiding differences?

Okay, then let's add a comment.

Thanks,
Florian
Subject: [PATCH] csu: Update __libgcc_s_init comment
To: libc-alpha@sourceware.org

2018-01-10  Florian Weimer  <fweimer@redhat.com>

	* sysdeps/gnu/unwind-resume.c (__libgcc_s_init): Update comment
	and error message.

diff --git a/sysdeps/gnu/unwind-resume.c b/sysdeps/gnu/unwind-resume.c
index 94704c9a2b..7f9a1bf2c7 100644
--- a/sysdeps/gnu/unwind-resume.c
+++ b/sysdeps/gnu/unwind-resume.c
@@ -35,13 +35,17 @@ __libgcc_s_init (void)
   void *resume, *personality;
   void *handle;
 
-  handle = __libc_dlopen (LIBGCC_S_SO);
+  /* Use RTLD_NOW here for consistency with pthread_cancel_init.
+     RTLD_NOW will rarely make a difference here because unwinding is
+     already in progress, so libgcc_s.so has already been loaded if
+     its unwinder is used.  */
+  handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
 
   if (handle == NULL
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
       || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
     __libc_fatal (LIBGCC_S_SO
-                  " must be installed for pthread_cancel to work\n");
+                  " must be installed for unwinding to work\n");
 
 #ifdef PTR_MANGLE
   PTR_MANGLE (resume);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]