[PATCH] elf: Do not use memalign for TCB/TLS blocks allocation [BZ #17730]
Florian Weimer
fweimer@redhat.com
Mon Jul 11 08:56:00 GMT 2016
On 07/11/2016 05:12 AM, Carlos O'Donell wrote:
> On 06/21/2016 07:38 AM, Florian Weimer wrote:
>> Instead, call malloc and explicitly align the pointer.
>>
>> There is no external location to store the original (unaligned)
>> pointer, and this commit increases the allocation size to store
>> the pointer at a fixed location relative to the TCB pointer.
>>
>> The manual alignment means that some space goes unused which
>> was previously made available for subsequent allocations.
>> However, in the TLS_DTV_AT_TP case, the manual alignment code
>> avoids aligning the pre-TCB to the TLS block alignment. (Even
>> while using memalign, the allocation had some unused padding
>> in front.)
>>
>> This concludes the removal of memalign calls from the TLS code,
>> and the new tst-tls3-malloc test verifies that only core malloc
>> routines are used.
>
> This looks good to me.
>
> Is the the test case 100% reliable? It seems to me that it should be,
> but I haven't scanned all of the paths through the TLS startup.
It seems to hit both cases (DTV and TCB/TLS allocation).
Thanks,
Florian
More information about the Libc-alpha
mailing list