Mac OS X mangler: follow some minor gcc changes
[ghc-hetmet.git] / driver / mangler / ghc-asm.lprl
index 902593e..ab43cdc 100644 (file)
@@ -298,7 +298,7 @@ sub init_TARGET_STUFF {
     $T_CONST_LBL    = '^\LC\d+:'; # regexp for what such a lbl looks like
     $T_POST_LBL            = ':';
 
-    $T_MOVE_DIRVS   = '^(\s*(\.align \d+|\.text|\.data|\.const_data|\.cstring|\.non_lazy_symbol_pointer|\.const|\.static_const|\.literal4|\.literal8|\.static_data|\.globl \S+|\.section .*|\.lcomm.*)\n)';
+    $T_MOVE_DIRVS   = '^(\s*(\.(p2)?align\s.*|\.text|\.data|\.const_data|\.cstring|\.non_lazy_symbol_pointer|\.const|\.static_const|\.literal4|\.literal8|\.static_data|\.globl \S+|\.section .*|\.lcomm.*)\n)';
     $T_COPY_DIRVS   = '\.(globl|lcomm)';
 
     $T_DOT_WORD            = '\.(long|short|byte|fill|space)';
@@ -326,7 +326,7 @@ sub init_TARGET_STUFF {
     $T_X86_PRE_LLBL        = 'L';
     $T_X86_BADJMP   = '^\tjmp [^L\*]';
 
-    $T_MOVE_DIRVS   = '^(\s*(\.align \d+|\.text|\.data|\.const_data|\.cstring|\.non_lazy_symbol_pointer|\.const|\.static_const|\.literal4|\.literal8|\.static_data|\.globl \S+|\.section .*|\.lcomm.*)\n)';
+    $T_MOVE_DIRVS   = '^(\s*(\.(p2)?align\s.*|\.text|\.data|\.const_data|\.cstring|\.non_lazy_symbol_pointer|\.const|\.static_const|\.literal4|\.literal8|\.static_data|\.globl \S+|\.section .*|\.lcomm.*)\n)';
     $T_COPY_DIRVS   = '\.(globl|lcomm)';
 
     $T_DOT_WORD            = '\.(long|short|byte|fill|space)';
@@ -699,6 +699,12 @@ sub mangle_asm {
            $chkcat[$i]  = 'data';
            $chksymb[$i] = '';
 
+        } elsif ( /^${T_US}([A-Za-z0-9_]+)_hpc?${T_POST_LBL}$/o ) {
+           # hpc shares tick boxes across modules
+           $chk[++$i]   = $_;
+           $chkcat[$i]  = 'data';
+           $chksymb[$i] = '';
+
        } elsif ( /^${T_US}([A-Za-z0-9_]+)_(alt|dflt)${T_POST_LBL}$/o ) {
            $chk[++$i]   = $_;
            $chkcat[$i]  = 'misc';
@@ -923,8 +929,8 @@ sub mangle_asm {
                    $p =~ s/^\tstw r0,\d+\(r1\)\n//g;
                    $p =~ s/^\tstwu r1,-\d+\(r1\)\n//; 
                    $p =~ s/^\tstw r\d+,-\d+\(r1\)\n//g; 
-                   $p =~ s/^\tbcl 20,31,L\d+\$pb\n//;
-                   $p =~ s/^L\d+\$pb:\n//;
+                   $p =~ s/^\tbcl 20,31,\"?L\d+\$pb\"?\n//;
+                   $p =~ s/^\"?L\d+\$pb\"?:\n//;
                    $p =~ s/^\tmflr r31\n//;
 
                    # This is bad: GCC 3 seems to zero-fill some local variables in the prologue