summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/PositionIndependentCode.hs
diff options
context:
space:
mode:
authorClemens Fruhwirth <clemens@endorphin.org>2007-07-06 11:24:49 +0000
committerClemens Fruhwirth <clemens@endorphin.org>2007-07-06 11:24:49 +0000
commitee40dd6ba3e4effa2cf6c6f06dc2b7477fc55f18 (patch)
tree7bbd1fa41d672f62a01466cf324202c574e05ddc /compiler/nativeGen/PositionIndependentCode.hs
parent39b41e2cbbcc9b672a5f25c2ab5d61ccc004c95e (diff)
downloadhaskell-ee40dd6ba3e4effa2cf6c6f06dc2b7477fc55f18.tar.gz
Fix -split-obj on Mac OS via -fasm
The problem of the splitter was that it re-emitted section directives for every dynamic label found. The following was torn apart .symbol_stubs .indirect <symbol> L_<symbol>$stub: jmp *... L_<symbol>$stub_binder: ..somebinding code.. into .symbol_stubs .indirect_symbol <symbol> L_<symbol>$stub: jmp *... .symbol_stubs <--- NEW L_<symbol>$stub_binder: ..somebinding code.. This is incorrect as the Mac OS assembler enforces that every new code section that goes into .symbol_stubs is associated with the linker directive .indirect_symbol. This sanity check is obviously violated when we reemit .symbol_stub in the splitter. The solution is to ignore everything that ends with $stub_binder as new label, and chuck it into a single label for $stub. Also the splitter has to recognize .section __DATA... for the lazy_ptr indirection symbol. Adds a reminder to PositionIndependentCode.hs to take care of the splitter when the code generation is changed. This should not affect -fvia-c as the code generated by the C compiler is entirely different.
Diffstat (limited to 'compiler/nativeGen/PositionIndependentCode.hs')
-rw-r--r--compiler/nativeGen/PositionIndependentCode.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/nativeGen/PositionIndependentCode.hs b/compiler/nativeGen/PositionIndependentCode.hs
index 4001078df1..6a94de22b2 100644
--- a/compiler/nativeGen/PositionIndependentCode.hs
+++ b/compiler/nativeGen/PositionIndependentCode.hs
@@ -372,6 +372,9 @@ pprGotDeclaration = Pretty.empty
-- On Darwin, we have to generate our own stub code for lazy binding..
-- For each processor architecture, there are two versions, one for PIC
-- and one for non-PIC.
+--
+-- Whenever you change something in this assembler output, make sure
+-- the splitter in driver/split/ghc-split.lprl recognizes the new output
pprImportedSymbol importedLbl
#if powerpc_TARGET_ARCH
| Just (CodeStub, lbl) <- dynamicLinkerLabelInfo importedLbl