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: [PATCH 1/1] aarch64:fix aarch64_tlsdesc conflict handling


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

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