* [parisc-linux] NPTL pthread_cancel and libgcc_s.so.2 vs. libgcc_s.so.1 (Why the DSO version bump?)
@ 2005-08-02 13:59 Carlos O'Donell
2005-08-02 14:13 ` [parisc-linux] " John David Anglin
0 siblings, 1 reply; 3+ messages in thread
From: Carlos O'Donell @ 2005-08-02 13:59 UTC (permalink / raw)
To: parisc-linux, John David Anglin
Dave,
When I attempt to test syscall cancellation with NPTL threads the
interface complains that:
libgcc_s.so.1 must be installed for pthread_cancel to work
I don't have this installed, instead I have libgcc_s.so.2 installed by
gcc 4.x during the tls toolchain compile/install.
The code in question is nptl/sysdeps/pthread/unwind-resume.c, which does this:
---
static void
init (void)
{
void *resume, *personality;
void *handle;
handle = __libc_dlopen ("libgcc_s.so.1");
if (handle == NULL
|| (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
|| (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
__libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");
libgcc_s_resume = resume;
libgcc_s_personality = personality;
}
---
or
---
void
pthread_cancel_init (void)
{
void *resume, *personality, *forcedunwind, *getcfa;
void *handle;
if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
return;
handle = __libc_dlopen ("libgcc_s.so.1");
if (handle == NULL
|| (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
|| (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL
|| (forcedunwind = __libc_dlsym (handle, "_Unwind_ForcedUnwind"))
== NULL
|| (getcfa = __libc_dlsym (handle, "_Unwind_GetCFA")) == NULL
#ifdef ARCH_CANCEL_INIT
|| ARCH_CANCEL_INIT (handle)
#endif
)
__libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");
libgcc_s_resume = resume;
libgcc_s_personality = personality;
libgcc_s_forcedunwind = forcedunwind;
libgcc_s_getcfa = getcfa;
}
---
It wants to "forward" the local calls for _Unwind_Resume, __gcc_personality_v0,
_Unwind_ForcedUnwind and _Unwind_GetCFA to those in ligcc_s.so.1.
The call sequence is like this:
(Enter cancellable syscall)
...
__libc_enable_asynccancel
__do_cancel
__pthread_unwind
(Calls _Unwind_GetCFA ...)
...
(Do the syscall)
...
__libc_disable_asynccancel
...
(Done)
This is called to enable unwinding out of a cancelled syscall.
What was the reason for DSO version bump in libgcc_s.so.1?
c.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-08-02 15:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-02 13:59 [parisc-linux] NPTL pthread_cancel and libgcc_s.so.2 vs. libgcc_s.so.1 (Why the DSO version bump?) Carlos O'Donell
2005-08-02 14:13 ` [parisc-linux] " John David Anglin
2005-08-02 15:42 ` Carlos O'Donell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.