Skip to content
Snippets Groups Projects
Commit f5c54ab3 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 2000-04-18 16:44:46 by simonmar]

Push directives over literal chunks when attempting to move them to
the following chunk on x86.  Occasionally gcc generates a .glob
directive some distance before the symbol it refers to, and we were
ending up with a whole load of .glob directives attached to strings,
and duplicated in each .o file when splitting.

This change reduces the size of my libHSstd_p.a from 43M (!!!) to 9M.
I think this problem must have appeared with gcc 2.95.2, but it's a
little strange that I didn't notice it until now.
parent f44833ed
No related branches found
No related tags found
No related merge requests found
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment