Also make proper references when not using fPIC but linking against dynamic libs
authorClemens Fruhwirth <clemens@endorphin.org>
Tue, 19 Jun 2007 14:29:31 +0000 (14:29 +0000)
committerClemens Fruhwirth <clemens@endorphin.org>
Tue, 19 Jun 2007 14:29:31 +0000 (14:29 +0000)
compiler/nativeGen/PositionIndependentCode.hs

index e2db9da..4001078 100644 (file)
@@ -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
         ]