Hi Max, Max Filippov wrote,
There are multiple errors in _dl_tlsdesc_dynamic:
- the reference C implementation should return pointer to the thread-local variable, not offset from the thread pointer, because the xtensa ABI expects TLSDESC_FN to return pointer to the TLS variable;
- addx8 used for indexing into dtv has its second and third registers in wrong order, the index must be multiplied by 8, not the base;
- the same addx8 uses wrong base: instead of dtv it adds the offset to the threadptr;
- the return value in the fast path is calculated as td->tlsinfo.ti_offset - __builtin_thread_pointer, not what was intended;
- both fast and slow paths should not subtract __builtin_thread_pointer from the result.
Signed-off-by: Max Filippov jcmvbkbc@gmail.com
Applied and pushed, Thanks Waldemar