This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/1] aarch64:fix aarch64_tlsdesc conflict handling
- From: Vaneet Narang <v dot narang at samsung dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, Maninder Singh <maninder1 dot s at samsung dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "marcus dot shawcroft at arm dot com" <marcus dot shawcroft at arm dot com>
- Cc: "mark dot hatle at windriver dot com" <mark dot hatle at windriver dot com>, AJEET YADAV <ajeet dot y at samsung dot com>, Hak-Bong Lee <hakbong5 dot lee at samsung dot com>, doha Hwang <doha dot hwang at samsung dot com>, PANKAJ MISHRA <pankaj dot m at samsung dot com>
- Date: Sat, 07 Nov 2015 03:03:58 +0000 (GMT)
- Subject: Re: [PATCH 1/1] aarch64:fix aarch64_tlsdesc conflict handling
- Authentication-results: sourceware.org; auth=none
- Dlp-filter: Pass
- Msgkey: 20151107024219991 at v dot narang
- Reply-to: v dot narang at samsung dot com
Hi ,
>> + if(conflict_start <= reloc && conflict_end >= reloc)
>> + td->entry = _dl_tlsdesc_return;
>> + else
>> + td->entry = _dl_tlsdesc_undefweak;
>this code could be better organised.
>(to have minimal impact on the non-prelinked case, e.g by
>leaving the original code alone and moving all the new
>special casing behind one if that checks for DT_GNU_CONFLICT.)
>isn't it possible to just pass a dummy sym in
>_dl_resolve_conflicts so we don't need any special
>target specific code?
Its not possible to pass dummy symbol without any changes in libc.
either we need to pass exact symbol and have to make entry in .dynsym section of executable
because loader fetches value of symbol and uses it.
Libc code :
td->arg = (void*)(sym->st_value + sym_map->l_tls_offset
+ reloc->r_addend);
or we can pass dummy symbol but still changes would be required
in libc code.
>is x86_64 tlsdesc also broken with prelinking?
I think Prelink of x86_64 doesn't support TLSDESC relocation.
When i compile libs with CC='gcc -mtls-dialect=gnu2', then
prelink fails with unknown relocation type R_X86_64_TLSDESC
error log: prelink: /lib/x86_64-linux-gnu/tls1lib2.so: Unknown X86-64 relocation type 36
Problem with aarch64 is aarch64 compiler by default compiles with -mtls-dialect=gnu2
You don't need to pass this flag to generate TLSDESC relocation,
so we need to support this relocation on AARCH64.
Thanks
Vaneet Narang