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: [PATCHi v2] aarch64: Add split-stack TCB field



On 14/02/2017 08:03, Florian Weimer wrote:
> On 02/13/2017 08:45 PM, Adhemerval Zanella wrote:
>> +/* This is the size we need before TCB.  Check if there is room for
>> +   tcbprehead_t in struct pthread's final padding and if not add it on
>> +   required pre-tcb size.  */
>> +# define TLS_PRE_TCB_SIZE \
>> +  (sizeof (struct pthread)                        \
>> +   + (PTHREAD_STRUCT_END_PADDING < sizeof (tcbprehead_t)        \
>> +      ? ALIGN_UP (sizeof (tcbprehead_t), sizeof (struct pthread))    \
>> +      : 0))
> 
> How does this preserve the alignment of struct pthread?

Indeed, it should be ALIGN_UP (sizeof (tcbprehead_t), __alignof__ (struct pthread)

> 
> It's also not clear to me how the “version control” aspect of __tcb_private_ss is supposed to work.  If the intent is to prevent loading of split-stack binaries with an older glibc, then a data symbol would be a safer choice.
> 

My idea is to mimic 67385a01d22 (powerpc: Add hwcap/hwcap2/platform data to TCB) and
is indeed to prevent new binaries to run on older glibc where the pre-tcb header
is not allocated.  I will check if a data symbol works better.


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