summaryrefslogtreecommitdiff
path: root/ghc/driver
diff options
context:
space:
mode:
authorwolfgang <unknown>2005-06-13 00:15:58 +0000
committerwolfgang <unknown>2005-06-13 00:15:58 +0000
commit59177a1b536b8a40924d8efa5520fb664447f92a (patch)
tree109f427a7bf297b58238c3ea6443bc7722009bdb /ghc/driver
parent3370ed763b1b71326fdebf143b840dc023170aab (diff)
downloadhaskell-59177a1b536b8a40924d8efa5520fb664447f92a.tar.gz
[project @ 2005-06-13 00:15:58 by wolfgang]
Darwin/x86: Fix two causes for crashes: *) align literals to 16 bytes, because Apple's GCC likes to use SSE instructions which require this alignment. *) In print_doctored, recognize global jumps that masquerade as local jumps by going via Lfoo$stub or Lfoo$non_lazy_ptr.
Diffstat (limited to 'ghc/driver')
-rw-r--r--ghc/driver/mangler/ghc-asm.lprl12
1 files changed, 11 insertions, 1 deletions
diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl
index ec12d79cf3..b95cad8b2a 100644
--- a/ghc/driver/mangler/ghc-asm.lprl
+++ b/ghc/driver/mangler/ghc-asm.lprl
@@ -332,7 +332,7 @@ sub init_TARGET_STUFF {
$T_DOT_WORD = '\.(long|short|byte|fill|space)';
$T_DOT_GLOBAL = '\.globl';
$T_HDR_toc = "\.toc\n";
- $T_HDR_literal = "\t\.const\n\t\.align 2\n";
+ $T_HDR_literal = "\t\.const\n\t\.align 4\n"; # align for SSE
$T_HDR_misc = "\t\.text\n\t\.align 2\n";
$T_HDR_data = "\t\.data\n\t\.align 2\n";
$T_HDR_rodata = "\t\.const\n\t\.align 2\n";
@@ -1532,6 +1532,16 @@ sub print_doctored {
# fix _all_ non-local jumps:
+ if ( $TargetPlatform =~ /^.*-apple-darwin.*/ ) {
+ # On Darwin, we've got local-looking jumps that are
+ # actually global (i.e. jumps to Lfoo$stub or via
+ # Lfoo$non_lazy_ptr), so we fix those first.
+ # In fact, we just fix everything that contains a dollar
+ # because false positives don't hurt here.
+
+ s/^(\tjmp\s+\*?L.*\$.*\n)/$exit_patch$1/g;
+ }
+
s/^\tjmp\s+\*${T_X86_PRE_LLBL_PAT}/\tJMP___SL/go;
s/^\tjmp\s+${T_X86_PRE_LLBL_PAT}/\tJMP___L/go;