[Issue 13939] IASM shouldn't access global symbol with PIC code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 6 14:34:40 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13939

--- Comment #2 from Martin Nowak <code at dawg.eu> ---
Like for TLS access to global PIC variables requires a particular instruction
sequence and relocation.
Particularly for i686 you need to add the GOT offset (there currently no way to
get that in IASM though).

BUT on amd64 it basically works fine because the compiler rewrites.

    mov RAX, val;

to

    mov RAX, val at RIP;

and also emits the correct relocation.

It will already fail for

    movdqa XMM1, val;

see bug 9378.

--


More information about the Digitalmars-d-bugs mailing list