X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=driver%2Fmangler%2Fghc-asm.lprl;h=88766cba88949241c8f3514f730311a0d9490019;hb=974d0c018057cda10dff6309de65bae8780190be;hp=4221b3d31a149214fca43594aeb855e38f89eaa3;hpb=79adecdb64e642f507e5113757ca69bc64df6bdc;p=ghc-hetmet.git diff --git a/driver/mangler/ghc-asm.lprl b/driver/mangler/ghc-asm.lprl index 4221b3d..88766cb 100644 --- a/driver/mangler/ghc-asm.lprl +++ b/driver/mangler/ghc-asm.lprl @@ -173,7 +173,13 @@ sub init_TARGET_STUFF { $T_X86_BADJMP = '^\tjmp\s+[^\.\*]'; $T_MOVE_DIRVS = '^(\s*(\.(p2)?align\s.*|\.globl\s+\S+|\.text|\.data|\.section\s+.*|\.type\s+.*|\.size\s+\S+\s*,\s*\d+|\.ident.*|\.local.*)\n)'; - $T_COPY_DIRVS = '^\s*\.(globl|type|size|local)'; + if ( $TargetPlatform =~ /solaris2/ ) { + # newer Solaris linkers are picky about .size information, so + # omit it (see #1421) + $T_COPY_DIRVS = '^\s*\.(globl|local)'; + } else { + $T_COPY_DIRVS = '^\s*\.(globl|type|size|local)'; + } $T_DOT_WORD = '\.(long|value|word|byte|zero)'; $T_DOT_GLOBAL = '\.globl'; @@ -218,7 +224,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*\.(globl|text|data|section|align|size|type|ident|local)\s+.*\n)'; + $T_MOVE_DIRVS = '^(\s*\.(globl|text|data|section|align|size|type|ident|local)([ \t].*)?\n)'; $T_COPY_DIRVS = '\.(globl|type|size|local)'; $T_DOT_WORD = '\.(quad|long|value|byte|zero)'; @@ -236,6 +242,8 @@ sub init_TARGET_STUFF { # where x is in the text section and y in the rodata section. # It works if y is in the text section, though. This is probably # going to cause difficulties for PIC, I imagine. + # + # See Note [x86-64-relative] in includes/InfoTables.h $T_HDR_relrodata= "\.text\n\t\.align 8\n"; $T_HDR_closure = "\.data\n\t\.align 8\n"; @@ -598,7 +606,7 @@ sub mangle_asm { # Labels ending "_str": these are literal strings. } elsif ( /^${T_US}([A-Za-z0-9_]+)_str${T_POST_LBL}$/ ) { $chk[++$i] = $_; - $chkcat[$i] = 'rodata'; + $chkcat[$i] = 'relrodata'; $chksymb[$i] = ''; } elsif ( $TargetPlatform =~ /-darwin/ && (/^\s*\.subsections_via_symbols/ @@ -942,13 +950,14 @@ sub mangle_asm { } # Remove floating-point spill instructions. - # Only fp registers 2-5 and 16-21 are saved by the runtime. - if ($p =~ s/^\tstf\.spill \[r1[4-9]\] = f([2-5]|1[6-9]|20|21)(, [0-9]+)?\n//g) { + # Only fp registers 2-5 and 16-23 are saved by the runtime. + if ($p =~ s/^\tstf\.spill \[r1[4-9]\] = f([2-5]|1[6-9]|2[0-3])(, [0-9]+)?\n//g) { # Being paranoid, only try to remove these if we saw a # spill operation. $p =~ s/^\tmov r1[4-9] = r12\n//; $p =~ s/^\tadds r1[4-9] = -[0-9]+, r12\n//g; $p =~ s/^\t\.save\.f 0x[0-9a-fA-F]\n//g; + $p =~ s/^\t\.save\.gf 0x0, 0x[0-9a-fA-F]+\n//g; } $p =~ s/^\tnop(?:\.[mifb])?\s+\d+\n//g; # remove nop instructions @@ -1118,8 +1127,8 @@ sub mangle_asm { $e =~ s/^\tmov r8 = r14\n//; # Remove floating-point fill instructions. - # Only fp registers 2-5 and 16-21 are saved by the runtime. - if ($e =~ s/^\tldf\.fill f([2-5]|1[6-9]|20|21) = \[r1[4-9]\](, [0-9]+)?\n//g) { + # Only fp registers 2-5 and 16-23 are saved by the runtime. + if ($e =~ s/^\tldf\.fill f([2-5]|1[6-9]|2[0-3]) = \[r1[4-9]\](, [0-9]+)?\n//g) { # Being paranoid, only try to remove this if we saw a fill # operation. $e =~ s/^\tadds r1[4-9] = [0-9]+, r12//g;