On Feb 23, 2013 6:20 PM, "Ben Davis" <entheh@cantab.net> wrote:
>
> Hi,
>
> Has anyone had any success using GDC to make DLLs to be called from C/C++?
>
> The reason I ask is, for me, the following snippet inside dll.d / dll_fixTLS() seems to have compiled to a call to abort():
>
>         void** peb;
>         asm
>         {
>             mov EAX,FS:[0x30];
>             mov peb, EAX;
>         }
>
> and thus dll_process_attach() crashes the process.
>
> 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?
>
> If I'm right, then I'm just wondering if anyone has any ideas on whether it could be fixed, and how?
>
> 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 :)
>

Only because shared libraries requires PIC, and quite a few of the IASM routines clobber the pic register.

Regards
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';