X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2Fdriver%2Fghc-asm.lprl;fp=ghc%2Fdriver%2Fghc-asm.lprl;h=4b221fe9ffb4a9928c1549477141201b98ccd132;hp=93c1c3a12abfe6e72514b197cf79778b7a5c7898;hb=f5c54ab379ec951275aa935e2d4854df41a58409;hpb=f44833ed4d9cda46d03895b0758ce54ac9a7bd98 diff --git a/ghc/driver/ghc-asm.lprl b/ghc/driver/ghc-asm.lprl index 93c1c3a..4b221fe 100644 --- a/ghc/driver/ghc-asm.lprl +++ b/ghc/driver/ghc-asm.lprl @@ -782,7 +782,28 @@ sub mangle_asm { # (this SEGVs perl4 on alphas, you see) $to_move = $1; - if ( $i < ($numchks - 1) + + # on x86 we try not to copy any directives into a literal + # chunk, rather we keep looking for the next real chunk. This + # is because we get things like + # + # .globl blah_closure + # .LC32 + # .string "..." + # blah_closure: + # ... + # + if ( $TargetPlatform =~ /^i386/ && $to_move =~ /$TCOPYDIRVS/ ) { + $j = $i + 1; + while ( $j < ($numchks - 1) && $chk[$j] =~ /$T_CONST_LBL/) { + $j++; + } + if ( $j < ($numchks - 1)) { + $chk[$j] = $to_move . $chk[$j]; + } + } + + elsif ( $i < ($numchks - 1) && ( $to_move =~ /$TCOPYDIRVS/ || ($TargetPlatform =~ /^hppa/ && $to_move =~ /align/ && $chkcat[$i+1] eq 'literal') )) { $chk[$i + 1] = $to_move . $chk[$i + 1];