Commit 8dfca69f authored by Matthew Pickering's avatar Matthew Pickering

Inline compiler/NOTES into X86/Ppr.hs

Reviewers: austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2721
parent d3542fad
Note [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).
The LLVM code gen already creates `iTableSuf` symbols, where
the X86 would generate the DeadStripPreventer (_dsp) symbol.
Therefore all that is left for llvm code gen, is to ensure
that all the `iTableSuf` symbols are marked as used.
As of this writing the documentation regarding the
.subsections_via_symbols and -dead_stip can be found at
<https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/Assembler/040-Assembler_Directives/asm_directives.html#//apple_ref/doc/uid/TP30000823-TPXREF101>
\ No newline at end of file
......@@ -68,7 +68,7 @@ pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
-- elimination, it might be the target of a goto.
(if platformHasSubsectionsViaSymbols platform
then
-- See Note [Subsections Via Symbols]
-- See Note [Subsections Via Symbols] in X86/Ppr.hs
text "\t.long "
<+> ppr info_lbl
<+> char '-'
......
......@@ -76,7 +76,7 @@ pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
-- elimination, it might be the target of a goto.
(if platformHasSubsectionsViaSymbols platform
then
-- See Note [Subsections Via Symbols]
-- See Note [Subsections Via Symbols] in X86/Ppr.hs
text "\t.long "
<+> ppr info_lbl
<+> char '-'
......
......@@ -48,6 +48,24 @@ import Data.Bits
-- -----------------------------------------------------------------------------
-- Printing this stuff out
--
--
-- Note [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).
--
-- The LLVM code gen already creates `iTableSuf` symbols, where
-- the X86 would generate the DeadStripPreventer (_dsp) symbol.
-- Therefore all that is left for llvm code gen, is to ensure
-- that all the `iTableSuf` symbols are marked as used.
-- As of this writing the documentation regarding the
-- .subsections_via_symbols and -dead_stip can be found at
-- <https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/Assembler/040-Assembler_Directives/asm_directives.html#//apple_ref/doc/uid/TP30000823-TPXREF101>
pprNatCmmDecl :: NatCmmDecl (Alignment, CmmStatics) Instr -> SDoc
pprNatCmmDecl (CmmData section dats) =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment