- if ($TargetPlatform =~ /^powerpc|^rs6000/) {
- print OUTASM $T_HDR_toc; # yes, we have to put a .toc
- # in the beginning of every file!
- %tocequiv = (); # maps toc symbol number to toc symbol
- %revtocequiv = (); # maps toc symbol to toc symbol number
- for ($i = 1; $i < $numchks; $i++) {
- $chk[$i] =~ s/\[RW\]//g;
- $chk[$i] =~ s/\[DS\]//g;
- $chk[$i] =~ s/^\.csect .*\[DS\]$//g;
-
- if ( $chkcat[$i] eq 'toc' && $chk[$i] !~ /\.byte/ )
-#ToDo: instead of all these changes, just fix mangle_powerpc_tailjump and delete/ignore these tocs?
- { $chk[$i] =~ s/$T_MOVE_DIRVS//g;
- $chk[$i] =~ s/\t\.tc (\S+)\[TC\],(\S+_fast\d+)/\t\.tc \1\[TC\],\.\2/;
- $chk[$i] =~ s/\t\.tc (\S+)\[TC\],(\S+_entry)\n/\t\.tc \1\[TC\],\.\2\n/;
- $chk[$i] =~ s/\t\.tc (\S+)\[TC\],(ret_\S+)/\t\.tc \1\[TC\],\.\2/;
- $chk[$i] =~ s/\t\.tc (\S+)\[TC\],(alt_\S+)/\t\.tc \1\[TC\],\.\2/;
- $chk[$i] =~ s/\t\.tc (\S+)\[TC\],(vtbl_\S+)/\t\.tc \1\[TC\],\.\2/;
-
- $tocnumber = $chksymb[$i];
- $tocsymb = $chk[$i];
- $tocsymb =~ s/^LC\.\.\d+:\n//;
- $tocsymb =~ s/^\t\.tc \S+,(\S+)\n/\1/;
- $tocequiv{$tocnumber} = $tocsymb;
-
- } elsif ( $chkcat[$i] eq 'toc' && $chk[$i] =~ /\.byte/ ) {
- $chkcat[$i] = 'literal';
- }
- }
- };
-
- for ($i = $FIRST_MANGLABLE; $i < $numchks; $i++) {