[Issue 9760] PIC code uses variable and thus needs a stack frame

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 19 23:17:06 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9760



--- Comment #2 from Martin Nowak <code at dawg.eu> 2013-03-19 23:17:05 PDT ---
The GOT loading code sequence doesn't work because I have no detailed control
about the emitted relocations. This uses a R_386_GOT32 relocation instead of
the needed R_386_GOTPC one.

----
extern(C) __gshared extern void* _GLOBAL_OFFSET_TABLE_;

void loadGOT()
{
    asm
    {
        naked;
        call Lgot;
    Lgot: pop EBX;
        add EBX, offsetof _GLOBAL_OFFSET_TABLE_ + 3;
    }
}
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list