[project @ 2005-05-10 10:41:00 by simonmar]
[ghc-hetmet.git] / ghc / driver / mangler / ghc-asm.lprl
index 3ba4e9b..935b2a4 100644 (file)
@@ -160,12 +160,12 @@ sub init_TARGET_STUFF {
     $T_HDR_vector   = "\.text\n\t\.align 2\n"; # NB: requires padding
 
     #--------------------------------------------------------#
-    } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|freebsd|netbsd|openbsd)$/ ) {
+    } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|gnu|freebsd|netbsd|openbsd)$/ ) {
 
     $T_STABBY      = 0; # 1 iff .stab things (usually if a.out format)
     $T_US          = ''; # _ if symbols have an underscore on the front
     $T_PRE_APP     = # regexp that says what comes before APP/NO_APP
-                     ($TargetPlatform =~ /-(linux|freebsd|netbsd|openbsd)$/) ? '#' : '/' ;
+                     ($TargetPlatform =~ /-(linux|gnu|freebsd|netbsd|openbsd)$/) ? '#' : '/' ;
     $T_CONST_LBL    = '^\.LC(\d+):$'; # regexp for what such a lbl looks like
     $T_POST_LBL            = ':';
     $T_X86_PRE_LLBL_PAT = '\.L';
@@ -550,6 +550,27 @@ sub mangle_asm {
             # code.
             # The .no_dead_strip directives are actually put there by
             # the gcc3 "used" attribute on entry points.
+        
+        } elsif ( $TargetPlatform =~ /^powerpc-apple-.*/ && ( 
+                  /^\s*\.picsymbol_stub/
+               || /^\s*\.section __TEXT,__picsymbol_stub1,.*/
+               || /^\s*\.section __TEXT,__picsymbolstub1,.*/
+               || /^\s*\.symbol_stub/
+               || /^\s*\.section __TEXT,__symbol_stub1,.*/
+               || /^\s*\.section __TEXT,__symbolstub1,.*/
+               || /^\s*\.lazy_symbol_pointer/
+               || /^\s*\.non_lazy_symbol_pointer/ ))
+       {
+           $chk[++$i]   = $_;
+           $chkcat[$i]  = 'dyld';
+           $chksymb[$i] = '';
+
+       } elsif ( $TargetPlatform =~ /^powerpc-apple-.*/ && $chkcat[$i] eq 'dyld' && /^\s*\.data/)
+       {       # non_lazy_symbol_ptrs that point to local symbols
+           $chk[++$i]   = $_;
+           $chkcat[$i]  = 'dyld';
+           $chksymb[$i] = '';
+
        } elsif ( /^\s+/ ) { # most common case first -- a simple line!
            # duplicated from the bottom
 
@@ -696,24 +717,6 @@ sub mangle_asm {
                $chkcat[$i]  = 'unknown';
            }
 
-       } elsif ( $TargetPlatform =~ /^powerpc-apple-.*/ && ( 
-                  /^\.picsymbol_stub/
-               || /^\.section __TEXT,__picsymbol_stub1,.*/
-               || /^\.section __TEXT,__picsymbolstub1,.*/
-               || /^\.symbol_stub/
-               || /^\.section __TEXT,__symbol_stub1,.*/
-               || /^\.section __TEXT,__symbolstub1,.*/
-               || /^\.lazy_symbol_pointer/
-               || /^\.non_lazy_symbol_pointer/ ))
-       {
-           $chk[++$i]   = $_;
-           $chkcat[$i]  = 'dyld';
-           $chksymb[$i] = '';
-       } elsif ( $TargetPlatform =~ /^powerpc-apple-.*/ && /^\.data/ && $chkcat[$i] eq 'dyld')
-       {       # non_lazy_symbol_ptrs that point to local symbols
-           $chk[++$i]   = $_;
-           $chkcat[$i]  = 'dyld';
-           $chksymb[$i] = '';
        } elsif ( $TargetPlatform =~ /^powerpc-.*-linux/ && /^\.LCTOC1 = /o ) {
                # PowerPC Linux's large-model PIC (-fPIC) generates a gobal offset
                # table "by hand". Be sure to copy it over.