[Mesa-dev] [Bug 35268] initial-exec TLS model breaks dlopen'ed libGL

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 7 21:05:42 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=35268

--- Comment #27 from Rich Felker <bugdal at aerifal.cx> ---
A couple issues with latest patches by Sora Lee:

1. There is no need for __attribute__((__tls_model__("global-dynamic"))). It's
rightly the default whenever it's needed by the ABI. The attribute should just
be removed.

2. There's at least one more place where the invalid initial-exec asm is
duplicated, in src/mapi/entry_x86{,-64}_tls.h.

3. Per the ABI, calling the TLSDESC function requires the stack pointer to be
aligned mod 16 (as for all function calls). This might not break in practice
but should be done.

I have a draft patch with all of these changes that seems to be working. Once I
check it over again I'll post it here.

Perhaps more to the point, though, the asm seems largely useless and I think it
should just be removed. Modern GCC generates exactly the same code for the C
stubs as what you get by doing the TLSDESC access in asm, except for some
functions that take char args where gcc performs a spurious zero/sign-extend
operation on the argument regissters before tail-calling through the dispatch.
Supposedly this is a known gcc bug that's going to be improved in gcc 9.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181107/b8a97ecd/attachment.html>


More information about the mesa-dev mailing list