pthread_cancel async-signal-safe

Joseph Myers joseph@codesourcery.com
Mon Dec 7 18:08:14 GMT 2020


On Mon, 7 Dec 2020, Adhemerval Zanella via Libc-alpha wrote:

> On 04/12/2020 15:32, Joseph Myers wrote:
> > On Fri, 4 Dec 2020, Adhemerval Zanella via Libc-alpha wrote:
> > 
> >> For 1. I don't see a easier solution without moving pthread_cancel_init
> >> to out of pthread_cancel and this has its own drawbacks (by always
> >> forcing loading libgcc_s.so when libpthread is linked).   
> > 
> > libgcc_s.so should indeed be loaded on startup (loading it later has the 
> > problem of introducing failures, if loading fails, in a context where 
> > failures aren't expected).
> 
> Indeed, it might be required to even loading it early as pthread_cancel 
> currently does or just add libgcc_s.so in DT_NEEDED for at least
> libpthread (and once we move all libpthread implementation to libc.so
> it will make programs always load libgcc_s.so).

Note that if you add it in DT_NEEDED, it should be done in a way that 
doesn't require the real libgcc_s.so to be built before libc.so is, to 
avoid bootstrapping issues.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list