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][BZ #17078] ARM: R_ARM_TLS_DESC prelinker support


On Tue, Jul 01, 2014 at 02:28:04PM +0100, Maciej W. Rozycki wrote:
> Hello,
> 
>  Here is a change to the dynamic linker to add prelinker support for the 
> R_ARM_TLS_DESC relocation.  Two cases can be considered here, the usual 
> one where lazy binding is in use and the less frequent one, where 
> immediate binding is requested via the use of the DF_BIND_NOW dynamic flag 
> (e.g. by using the GNU linker's "-z now" option).
> 
>  The change below only handle the first case.  In this scenario the 

Given that there seems to be an intent for glibc to move towards safe
allocation of TLS at dlopen/pthread_create time rather than lazy
allocation (which inherently leads to crashing under memory
exhaustion), I don't think it's useful to focus on the lazy case,
which also crashes if there's no memory for the tls index structure.
Rather the lazy case should eventually be removed.

Technically it's possible to support the lazy case without crashing on
memory exhaustion, by simply re-doing the lookup every time the symbol
is referenced if allocation fails. But I really doubt anybody wants to
implement that hideously-slow fallback. And the allocation also makes
the accesses async-signal-unsafe, which is another bug that should be
fixed.

Rich


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