diff options
author | Ian Lynagh <igloo@earth.li> | 2011-10-19 16:57:38 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-10-19 16:57:38 +0100 |
commit | 723929bcee68add69f866f42dc3a610e6db638d0 (patch) | |
tree | 331da3ad2797f5396902eed92c889018e505f1ab /compiler/nativeGen | |
parent | a6f9ebc58b0dc632bb01d0f202a7581ed02466ce (diff) | |
download | haskell-723929bcee68add69f866f42dc3a610e6db638d0.tar.gz |
Remove all Haskell conditionals on HAVE_SUBSECTIONS_VIA_SYMBOLS
We now use the value from the targetPlatform instead.
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r-- | compiler/nativeGen/AsmCodeGen.lhs | 14 | ||||
-rw-r--r-- | compiler/nativeGen/PPC/Ppr.hs | 34 | ||||
-rw-r--r-- | compiler/nativeGen/SPARC/Ppr.hs | 34 | ||||
-rw-r--r-- | compiler/nativeGen/X86/Ppr.hs | 36 |
4 files changed, 59 insertions, 59 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs index 09b3bf2ec5..5b133d085a 100644 --- a/compiler/nativeGen/AsmCodeGen.lhs +++ b/compiler/nativeGen/AsmCodeGen.lhs @@ -500,13 +500,13 @@ x86fp_kludge (CmmProc info lbl (ListGraph code)) = makeImportsDoc :: DynFlags -> [CLabel] -> Pretty.Doc makeImportsDoc dflags imports = dyld_stubs imports - -#if HAVE_SUBSECTIONS_VIA_SYMBOLS - -- On recent versions of Darwin, the linker supports - -- dead-stripping of code and data on a per-symbol basis. - -- There's a hack to make this work in PprMach.pprNatCmmDecl. - Pretty.$$ Pretty.text ".subsections_via_symbols" -#endif + Pretty.$$ + -- On recent versions of Darwin, the linker supports + -- dead-stripping of code and data on a per-symbol basis. + -- There's a hack to make this work in PprMach.pprNatCmmDecl. + (if platformHasSubsectionsViaSymbols (targetPlatform dflags) + then Pretty.text ".subsections_via_symbols" + else Pretty.empty) #if HAVE_GNU_NONEXEC_STACK -- On recent GNU ELF systems one can mark an object file -- as not requiring an executable stack. If all objects diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index b40c0e9431..35c4d64ef8 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -67,28 +67,28 @@ pprNatCmmDecl platform (CmmProc Nothing lbl (ListGraph blocks)) = pprNatCmmDecl platform (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blocks)) = pprSectionHeader Text $$ ( -#if HAVE_SUBSECTIONS_VIA_SYMBOLS - pprCLabel_asm platform (mkDeadStripPreventer info_lbl) - <> char ':' $$ -#endif + (if platformHasSubsectionsViaSymbols platform + then pprCLabel_asm platform (mkDeadStripPreventer info_lbl) <> char ':' + else empty) $$ vcat (map (pprData platform) info) $$ pprLabel platform info_lbl ) $$ - vcat (map (pprBasicBlock platform) blocks) + vcat (map (pprBasicBlock platform) blocks) $$ -- above: Even the first block gets a label, because with branch-chain -- elimination, it might be the target of a goto. -#if HAVE_SUBSECTIONS_VIA_SYMBOLS - -- If we are using the .subsections_via_symbols directive - -- (available on recent versions of Darwin), - -- we have to make sure that there is some kind of reference - -- from the entry code to a label on the _top_ of of the info table, - -- so that the linker will not think it is unreferenced and dead-strip - -- it. That's why the label is called a DeadStripPreventer (_dsp). - $$ text "\t.long " - <+> pprCLabel_asm platform info_lbl - <+> char '-' - <+> pprCLabel_asm platform (mkDeadStripPreventer info_lbl) -#endif + (if platformHasSubsectionsViaSymbols platform + then + -- If we are using the .subsections_via_symbols directive + -- (available on recent versions of Darwin), + -- we have to make sure that there is some kind of reference + -- from the entry code to a label on the _top_ of of the info table, + -- so that the linker will not think it is unreferenced and dead-strip + -- it. That's why the label is called a DeadStripPreventer (_dsp). + text "\t.long " + <+> pprCLabel_asm platform info_lbl + <+> char '-' + <+> pprCLabel_asm platform (mkDeadStripPreventer info_lbl) + else empty) pprBasicBlock :: Platform -> NatBasicBlock Instr -> Doc diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs index 4f7e264787..9d0ed2a916 100644 --- a/compiler/nativeGen/SPARC/Ppr.hs +++ b/compiler/nativeGen/SPARC/Ppr.hs @@ -64,28 +64,28 @@ pprNatCmmDecl platform (CmmProc Nothing lbl (ListGraph blocks)) = pprNatCmmDecl platform (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blocks)) = pprSectionHeader Text $$ ( -#if HAVE_SUBSECTIONS_VIA_SYMBOLS - pprCLabel_asm platform (mkDeadStripPreventer info_lbl) - <> char ':' $$ -#endif + (if platformHasSubsectionsViaSymbols platform + then pprCLabel_asm platform (mkDeadStripPreventer info_lbl) <> char ':' + else empty) $$ vcat (map (pprData platform) info) $$ pprLabel platform info_lbl ) $$ - vcat (map (pprBasicBlock platform) blocks) + vcat (map (pprBasicBlock platform) blocks) $$ -- above: Even the first block gets a label, because with branch-chain -- elimination, it might be the target of a goto. -#if HAVE_SUBSECTIONS_VIA_SYMBOLS - -- If we are using the .subsections_via_symbols directive - -- (available on recent versions of Darwin), - -- we have to make sure that there is some kind of reference - -- from the entry code to a label on the _top_ of of the info table, - -- so that the linker will not think it is unreferenced and dead-strip - -- it. That's why the label is called a DeadStripPreventer (_dsp). - $$ text "\t.long " - <+> pprCLabel_asm platform info_lbl - <+> char '-' - <+> pprCLabel_asm platform (mkDeadStripPreventer info_lbl) -#endif + (if platformHasSubsectionsViaSymbols platform + then + -- If we are using the .subsections_via_symbols directive + -- (available on recent versions of Darwin), + -- we have to make sure that there is some kind of reference + -- from the entry code to a label on the _top_ of of the info table, + -- so that the linker will not think it is unreferenced and dead-strip + -- it. That's why the label is called a DeadStripPreventer (_dsp). + text "\t.long " + <+> pprCLabel_asm platform info_lbl + <+> char '-' + <+> pprCLabel_asm platform (mkDeadStripPreventer info_lbl) + else empty) pprBasicBlock :: Platform -> NatBasicBlock Instr -> Doc diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index ab93e2dbb9..928bccfcd7 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -65,29 +65,29 @@ pprNatCmmDecl platform (CmmProc Nothing lbl (ListGraph blocks)) = pprNatCmmDecl platform (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blocks)) = pprSectionHeader platform Text $$ ( -#if HAVE_SUBSECTIONS_VIA_SYMBOLS - pprCLabel_asm platform (mkDeadStripPreventer info_lbl) - <> char ':' $$ -#endif + (if platformHasSubsectionsViaSymbols platform + then pprCLabel_asm platform (mkDeadStripPreventer info_lbl) <> char ':' + else empty) $$ vcat (map (pprData platform) info) $$ pprLabel platform info_lbl ) $$ - vcat (map (pprBasicBlock platform) blocks) + vcat (map (pprBasicBlock platform) blocks) $$ -- above: Even the first block gets a label, because with branch-chain -- elimination, it might be the target of a goto. -#if HAVE_SUBSECTIONS_VIA_SYMBOLS - -- If we are using the .subsections_via_symbols directive - -- (available on recent versions of Darwin), - -- we have to make sure that there is some kind of reference - -- from the entry code to a label on the _top_ of of the info table, - -- so that the linker will not think it is unreferenced and dead-strip - -- it. That's why the label is called a DeadStripPreventer (_dsp). - $$ text "\t.long " - <+> pprCLabel_asm platform info_lbl - <+> char '-' - <+> pprCLabel_asm platform (mkDeadStripPreventer info_lbl) -#endif - $$ pprSizeDecl platform info_lbl + (if platformHasSubsectionsViaSymbols platform + then + -- If we are using the .subsections_via_symbols directive + -- (available on recent versions of Darwin), + -- we have to make sure that there is some kind of reference + -- from the entry code to a label on the _top_ of of the info table, + -- so that the linker will not think it is unreferenced and dead-strip + -- it. That's why the label is called a DeadStripPreventer (_dsp). + text "\t.long " + <+> pprCLabel_asm platform info_lbl + <+> char '-' + <+> pprCLabel_asm platform (mkDeadStripPreventer info_lbl) + else empty) $$ + pprSizeDecl platform info_lbl -- | Output the ELF .size directive. pprSizeDecl :: Platform -> CLabel -> Doc |