<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - initial-exec TLS model breaks dlopen'ed libGL"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=35268#c23">Comment # 23</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - initial-exec TLS model breaks dlopen'ed libGL"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=35268">bug 35268</a>
              from <span class="vcard"><a class="email" href="mailto:saih792@outlook.com" title="Sora Lee <saih792@outlook.com>"> <span class="fn">Sora Lee</span></a>
</span></b>
        <pre>(In reply to Rich Felker from <a href="show_bug.cgi?id=35268#c22">comment #22</a>)
<span class="quote">> Ping.

> Looking at this again, I see the original proposed patch introduced a lot of
> extra asm to save/restore registers that might be clobbered by
> __tls_get_addr. That could all go away if tlsdesc support is assumed and
> used.

> The patch also adds some dubious prefix bytes to instructions in
> _x86_64_get_dispatch. Is there any reason for that?</span >

I believe the operand size override prefixes are necessary to use @TLSGD on the
x86-64 architecture.

I've remade the original patches for compatibility with mesa 18.2.2 and
implemented TLSDESC as you suggested using
<a href="https://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-x86.txt">https://www.fsfla.org/~lxoliva/writeups/TLS/RFC-TLSDESC-x86.txt</a> as a guide,
however I still seem to be getting issues with the _glapi_tls_Dispatch symbol.
In particular, my test code (dlopen_test.c) throws:

dlopen failed with message 'Error relocating /usr/lib/libglapi.so:
_glapi_tls_Dispatch: initial-exec TLS resolves to dynamic definition in
/usr/lib/libglapi.so'</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>