X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2Fmangler%2Fghc-asm.lprl;h=902593ea7f1a52467fe9a9f79e6f84ffce6b89db;hb=28a464a75e14cece5db40f2765a29348273ff2d2;hp=1c75f00d2b331d04381056c86692575a3e066de2;hpb=9342a543736bc7a015ec5857d20e98001c9e990f;p=ghc-hetmet.git diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index 1c75f00..902593e 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -160,7 +160,7 @@ sub init_TARGET_STUFF { $T_HDR_vector = "\.text\n\t\.align 2\n"; # NB: requires padding #--------------------------------------------------------# - } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|gnu|freebsd|netbsd|openbsd)$/ ) { + } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|gnu|freebsd|netbsd|openbsd|kfreebsdgnu)$/ ) { $T_STABBY = 0; # 1 iff .stab things (usually if a.out format) $T_US = ''; # _ if symbols have an underscore on the front @@ -219,7 +219,7 @@ sub init_TARGET_STUFF { $T_POST_LBL = ':'; $T_MOVE_DIRVS = '^(\s*\.(globl|text|data|section|align|size|type|ident|local)\s+.*\n)'; - $T_COPY_DIRVS = '\.(globl|local)'; + $T_COPY_DIRVS = '\.(globl|type|size|local)'; $T_DOT_WORD = '\.(quad|long|value|byte|zero)'; $T_DOT_GLOBAL = '\.global'; @@ -588,17 +588,28 @@ sub mangle_asm { || /^\s*\.section __TEXT,__symbol_stub\d,.*/ || /^\s*\.section __TEXT,__symbolstub\d,.*/ || /^\s*\.lazy_symbol_pointer/ - || /^\s*\.non_lazy_symbol_pointer/ )) + || /^\s*\.non_lazy_symbol_pointer/ + || /^\s*\.section __IMPORT.*/)) { $chk[++$i] = $_; $chkcat[$i] = 'dyld'; $chksymb[$i] = ''; + $dyld_section = $_; } elsif ( $TargetPlatform =~ /^.*-apple-darwin.*/ && $chkcat[$i] eq 'dyld' && /^\s*\.data/) { # non_lazy_symbol_ptrs that point to local symbols $chk[++$i] = $_; $chkcat[$i] = 'dyld'; $chksymb[$i] = ''; + $dyld_section = $_; + } elsif ( $TargetPlatform =~ /^.*-apple-darwin.*/ && $chkcat[$i] eq 'dyld' && /^\s*\.align/) + { # non_lazy_symbol_ptrs that point to local symbols + $dyld_section .= $_; + } elsif ( $TargetPlatform =~ /^.*-apple-darwin.*/ && $chkcat[$i] eq 'dyld' && /^L_.*:$/) + { # non_lazy_symbol_ptrs that point to local symbols + $chk[++$i] = $dyld_section . $_; + $chkcat[$i] = 'dyld'; + $chksymb[$i] = ''; } elsif ( /^\s+/ ) { # most common case first -- a simple line! # duplicated from the bottom @@ -953,16 +964,6 @@ sub mangle_asm { $p =~ s/^\tstdu 1,-\d+\(1\)\n//; $p =~ s/^\tstd \d+,-?\d+\(1\)\n//g; - # GCC's "large-model" PIC (-fPIC) - $pcrel_label = $p; - $pcrel_label =~ s/(.|\n)*^.LCF(\d+):\n(.|\n)*/$2/ or $pcrel_label = ""; - - $p =~ s/^\tbcl 20,31,.LCF\d+\n//; - $p =~ s/^.LCF\d+:\n//; - $p =~ s/^\tmflr 30\n//; - $p =~ s/^\tlwz 0,\.LCL\d+-\.LCF\d+\(30\)\n//; - $p =~ s/^\tadd 30,0,30\n//; - # This is bad: GCC 3 seems to zero-fill some local variables in the prologue # under some circumstances, only when generating position dependent code. # I have no idea why, and I don't think it is necessary, so let's toss it.