$T_STABBY = 0; # 1 iff .stab things (usually if a.out format)
$T_US = ''; # _ if symbols have an underscore on the front
$T_PRE_APP = # regexp that says what comes before APP/NO_APP
- ($TargetPlatform =~ /-(linux|freebsd|netbsd)$/) ? '#' : '/' ;
+ ($TargetPlatform =~ /-(linux|freebsd|netbsd|openbsd)$/) ? '#' : '/' ;
$T_CONST_LBL = '^\.LC(\d+):$'; # regexp for what such a lbl looks like
$T_POST_LBL = ':';
$T_X86_PRE_LLBL_PAT = '\.L';
$T_HDR_data = "\.data\n\t\.align 8\n";
$T_HDR_rodata = "\.text\n\t\.align 4\n";
$T_HDR_closure = "\.data\n\t\.align 4\n";
+ $T_HDR_info = "\.text\n\t\.align 4\n";
$T_HDR_entry = "\.text\n\t\.align 4\n";
$T_HDR_vector = "\.text\n\t\.align 4\n";
$chkcat[$i] = 'data';
$chksymb[$i] = '';
- # Labels beginning "_c": these are literal strings.
- } elsif ( /^${T_US}_c.*$/ ) {
+ # Labels ending "_str": these are literal strings.
+ } elsif ( /^${T_US}([A-Za-z0-9_]+)_str${T_POST_LBL}$/ ) {
$chk[++$i] = $_;
$chkcat[$i] = 'rodata';
$chksymb[$i] = '';
local($thing);
chop($thing = $_);
$thing =~ s/:$//;
- print STDERR "Warning: retaining unknown function \`$thing' in output from C compiler\n"
- unless # $KNOWN_FUNNY_THING{$thing}
+ $chk[++$i] = $_;
+ $chksymb[$i] = '';
+ if (
/^${T_US}stg_.*${T_POST_LBL}$/o # RTS internals
|| /^${T_US}__stg_.*${T_POST_LBL}$/o # more RTS internals
|| /^${T_US}__fexp_.*${T_POST_LBL}$/o # foreign export
|| /^${T_US}.*_srtd${T_POST_LBL}$/o # large bitmaps
|| /^${T_US}.*_fast${T_POST_LBL}$/o # primops
|| /^${T_US}.*_closure_tbl${T_POST_LBL}$/o # closure tables
- || /^_uname:/o; # x86/Solaris2
- $chk[++$i] = $_;
- $chkcat[$i] = 'misc';
- $chksymb[$i] = '';
+ || /^_uname:/o # x86/Solaris2
+ ) {
+ $chkcat[$i] = 'misc';
+ } else {
+ print STDERR "Warning: retaining unknown function \`$thing' in output from C compiler\n";
+ $chkcat[$i] = 'unknown';
+ }
} elsif ( $TargetPlatform =~ /^powerpc-apple-.*/ && (
/^\.picsymbol_stub/
# On SPARCs, we don't do --- BEGIN/END ---, we just
# toss the register-windowing save/restore/ret* instructions
- # directly:
+ # directly unless they've been generated by function definitions in header
+ # files on Solaris:
if ( $TargetPlatform =~ /^sparc-/ ) {
- $c =~ s/^\t(save.*|restore.*|ret|retl)\n//g;
+ if ( ! ( $TargetPlatform =~ /solaris2$/ && $chkcat[$i] eq 'unknown' )) {
+ $c =~ s/^\t(save.*|restore.*|ret|retl)\n//g;
+ }
# throw away PROLOGUE comments
$c =~ s/^\t!#PROLOGUE# 0\n\t!#PROLOGUE# 1\n//;
}
next if $chkcat[$i] eq 'DONE ALREADY';
- if ( $chkcat[$i] eq 'misc' ) {
+ if ( $chkcat[$i] eq 'misc' || $chkcat[$i] eq 'unknown' ) {
if ($chk[$i] ne '') {
print OUTASM $T_HDR_misc;
&print_doctored($chk[$i], 0);