X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FPositionIndependentCode.hs;h=4001078df1f29c100bb05df9910f5e29495949be;hb=46b28f7bfdd535e9fe5217a1151bedfb2cc15472;hp=ead98632ed17da4e39fda2244efa9c67ab2e7284;hpb=76e26e9cbb54efc31dde95c927ea8af17439febf;p=ghc-hetmet.git diff --git a/compiler/nativeGen/PositionIndependentCode.hs b/compiler/nativeGen/PositionIndependentCode.hs index ead9863..4001078 100644 --- a/compiler/nativeGen/PositionIndependentCode.hs +++ b/compiler/nativeGen/PositionIndependentCode.hs @@ -131,7 +131,7 @@ cmmMakePicReference :: CLabel -> CmmExpr -- 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 ] @@ -200,7 +200,7 @@ howToAccessLabel DataReference 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: @@ -442,7 +442,7 @@ pprImportedSymbol importedLbl 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