<div dir="ltr">I saw a very similar looking bug the other night, linker was trying to make the TLS reloc 32 bit, things were setup for regular shared , and we got ugly segfaults.   The best result I got in that case was -fPIE and -model=medium (intel assembler undocumented, but it's not doing much complicated.  The 32 bit TLS reloc changed to an X86_64_64 reloc... and yes, it did appear to change it to a 64 bit reloc, probably designed for situations like this. <br><br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">GNOMETOYS<br></div></div>
<br><div class="gmail_quote">On Thu, Nov 9, 2017 at 7:15 AM, Joerg Sonnenberger via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Nov 08, 2017 at 12:46:20PM -0800, Rui Ueyama via llvm-dev wrote:<br>
> So, looks like there are programs in where TLS relaxation actually matters.<br>
> It is interesting that both examples mentioned in this threads are<br>
> graphics-related (OpenGL and games). I wonder if it is a coincidence or it<br>
> is a common practice to use thread-local variables heavily in graphics. I<br>
> haven't wrote any games before, so it is likely that I don't know some<br>
> basics in that area.<br>
<br>
</span>In the OpenGL case it is primary an effect of retrofitting thread-safety<br>
into existing APIs. Just like some systems retrofit many of the<br>
non-reentrant libc functions by using thread-local storage for the<br>
buffers.<br>
<br>
Joerg<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>