<p><br>
On Feb 23, 2013 6:20 PM, "Ben Davis" <<a href="mailto:entheh@cantab.net">entheh@cantab.net</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> Has anyone had any success using GDC to make DLLs to be called from C/C++?<br>
><br>
> The reason I ask is, for me, the following snippet inside dll.d / dll_fixTLS() seems to have compiled to a call to abort():<br>
><br>
>         void** peb;<br>
>         asm<br>
>         {<br>
>             mov EAX,FS:[0x30];<br>
>             mov peb, EAX;<br>
>         }<br>
><br>
> and thus dll_process_attach() crashes the process.<br>
><br>
> It seems like a bug that would affect more people than just me, yet I couldn't find any evidence of other people hitting it. Have I got it right what's happening, or is something else at work?<br>
><br>
> If I'm right, then I'm just wondering if anyone has any ideas on whether it could be fixed, and how?<br>
><br>
> Also, I found some discussion about D-style inline asm being problematic and worthy of removal, but didn't find any explanation as to what those problems were. I'm curious :)<br>
></p>
<p>Only because shared libraries requires PIC, and quite a few of the IASM routines clobber the pic register. </p>
<p>Regards<br>
-- <br>
Iain Buclaw</p>
<p>*(p < e ? p++ : p) = (c & 0x0f) + '0';<br>
</p>