[PATCH] elf: Assume TLS is initialized in _dl_map_object_from_fd

Florian Weimer fweimer@redhat.com
Tue Nov 22 14:08:00 GMT 2016


On 11/14/2016 03:57 PM, Florian Weimer wrote:
> 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).

I will check this in soon unless someone objects.

TLS initialization has P&C issues, and I hope this cleanup makes it 
easier to fix that.  (It is impossible to review dead code for P&C issues.)

Thanks,
Florian



More information about the Libc-alpha mailing list