$chk[$i] .= $_;
- } elsif ( /^_(ret_|djn_)/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'misc';
- $chksymb[$i] = '';
-
- } elsif ( /^_vtbl_([A-Za-z0-9_]+):$/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'vector';
- $chksymb[$i] = $1;
-
- $vectorchk{$1} = $i;
-
- } elsif ( /^_([A-Za-z0-9_]+)DirectReturn:$/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'direct';
- $chksymb[$i] = $1;
-
- $directchk{$1} = $i;
-
- } elsif ( /^_[A-Za-z0-9_]+_upd:$/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'misc';
- $chksymb[$i] = '';
-
} elsif ( /^LC(\d+):$/ ) {
$chk[++$i] .= $_;
$chkcat[$i] = 'string';
$chkcat[$i] = 'infotbl';
$chksymb[$i] = $symb;
+ die "Info table already? $symb; $i\n" if defined($infochk{$symb});
+
$infochk{$symb} = $i;
} elsif ( /^_([A-Za-z0-9_]+)_entry:$/ ) {
$chkcat[$i] = 'data';
$chksymb[$i] = '';
+ } elsif ( /^_(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^_vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^_[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
} elsif ( /^_[A-Za-z0-9_]/ ) {
local($thing);
chop($thing = $_);
print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
# entry code will be put here!
+ # paranoia
+ if ( $chk[$infochk{$symb}] =~ /\.long\s+([A-Za-z0-9_]+_entry)$/
+ && $1 ne "_${symb}_entry" ) {
+ print STDERR "!!! entry point???\n",$chk[$infochk{$symb}];
+ }
+
$chkcat[$infochk{$symb}] = 'DONE ALREADY';
}
# teach it to drop through to the fast entry point:
$c = $chk[$slowchk{$symb}];
- $c =~ s/^\tjmp _${symb}_fast\d+.*\n\tnop\n//;
- $c =~ s/^\tjmp _${symb}_fast\d+.*\n//;
+
+ if ( defined($fastchk{$symb}) ) {
+ $c =~ s/^\tjmp _${symb}_fast\d+.*\n\tnop\n//;
+ $c =~ s/^\tjmp _${symb}_fast\d+.*\n//;
+ }
print STDERR "still has jump to fast entry point:\n$c"
- if $c =~ /_${symb}_fast/;
+ if $c =~ /_${symb}_fast/; # NB: paranoia
print OUTASM "\.text\n\t\.even\n";
print OUTASM $c;