-- everything gets relocated at runtime
cmmMakePicReference lbl
- | opt_PIC && absoluteLabel lbl = CmmMachOp (MO_Add wordRep) [
+ | (opt_PIC || not opt_Static) && absoluteLabel lbl = CmmMachOp (MO_Add wordRep) [
CmmReg (CmmGlobal PicBaseReg),
CmmLit $ picRelative lbl
]
| otherwise = AccessDirectly
-#if x86_TARGET_ARCH || x86_64_TARGET_ARCH
+#if i386_TARGET_ARCH || x86_64_TARGET_ARCH
-- dyld code stubs don't work for tailcalls because the
-- stack alignment is only right for regular calls.
-- Therefore, we have to go via a symbol pointer:
-- (AccessDirectly, because we get an implicit symbol stub)
-- and calling functions from PIC code on non-i386 platforms (via a symbol stub)
-howToAccessLabel CallLabel lbl
+howToAccessLabel CallReference lbl
| labelDynamic lbl && not opt_PIC
= AccessDirectly
#if !i386_TARGET_ARCH
| labelDynamic lbl && opt_PIC
- = AccessViaSymbolStub
+ = AccessViaStub
#endif
howToAccessLabel _ lbl
ptext SLIT("1:"),
ptext SLIT("\tmovl L") <> pprCLabel_asm lbl
<> ptext SLIT("$lazy_ptr-1b(%eax),%edx"),
- ptext SLIT("\tjmp %edx"),
+ ptext SLIT("\tjmp *%edx"),
ptext SLIT("L") <> pprCLabel_asm lbl
<> ptext SLIT("$stub_binder:"),
ptext SLIT("\tlea L") <> pprCLabel_asm lbl