import FastString
import qualified Outputable
-import CmdLineOpts ( opt_PIC )
+import CmdLineOpts ( opt_PIC, opt_Static )
#if __GLASGOW_HASKELL__ >= 504
import Data.Array.ST
-- -----------------------------------------------------------------------------
-- pprData: print a 'CmmStatic'
+#if defined(linux_TARGET_OS)
+#if defined(powerpc_TARGET_ARCH) || defined(i386_TARGET_ARCH)
+ -- Hack to make dynamic linking work
+pprSectionHeader ReadOnlyData
+ | not opt_PIC && not opt_Static
+ = pprSectionHeader Data
+#endif
+#endif
+
pprSectionHeader Text
= ptext
IF_ARCH_alpha(SLIT("\t.text\n\t.align 3") {-word boundary-}
ptext SLIT("\tffree %st(4) ;ffree %st(5) ;ffree %st(6) ;ffree %st(7)")
]
+pprInstr (FETCHGOT reg)
+ = vcat [ ptext SLIT("\tcall 1f"),
+ hcat [ ptext SLIT("1:\tpopl\t"), pprReg I32 reg ],
+ hcat [ ptext SLIT("\taddl\t$_GLOBAL_OFFSET_TABLE_+(.-1b), "),
+ pprReg I32 reg ]
+ ]
-- Emit code to make hi_reg:lo_reg be the 64-bit product of hi_reg and lo_reg
pprInstr_imul64 hi_reg lo_reg