[PATCH] elf: Assume TLS is initialized in _dl_map_object_from_fd (was: Re: Question about elf/dl-load.c)

Florian Weimer fweimer@redhat.com
Mon Nov 14 14:57:00 GMT 2016


On 11/11/2016 10:17 PM, Florian Weimer wrote:

> And so on.  My question is this: Can we actually enter the final part,
> under “We can do the TLS right now!” in a shared build?
>
> I doubt that because during the initial link, we will hit the second
> break statement for libraries, and the third break statement for the
> main program.  Before user code runs, rtld.c sets up the TLS data
> structures, so any future dlopen calls hit the second break again
> because GL(dl_tls_dtv_slotinfo_list) != NULL at this point.
>
> Is this reasoning correct?  I put in a debug printf and ran the elf
> tests, and there was nothing printed.

I've simplified the code accordingly and added asserts.

I have verified that the elf/* test suite still passes on s390, s390x, 
ppc64, ppc, x86_64, i386.  On x86_64, I also performed an installed-tree 
test (and the assert did not fire).

Thanks,
Florian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pt_tls.patch
Type: text/x-patch
Size: 2443 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20161114/35d85e95/attachment.bin>


More information about the Libc-alpha mailing list