source-engine-2018-hl2_src/devtools/bin/check_gcc_compile.pl
FluorescentCIAAfricanAmerican 3bf9df6b27 1
2020-04-22 12:56:21 -04:00

24 lines
439 B
Perl

#! perl
# scan all .o files for illegal instructions from passing aggregates to varargs functions.
use File::Find;
find( \&CheckFile, "." );
sub CheckFile
{
return unless (/\.o$/ );
open( DIS, "objdump --disassemble -C $_|" ) || die "can't process $_";
while( <DIS> )
{
$symbol = $1 if ( /^[0-9]+ \<(.*)\>:/ );
if ( /\s+ud2a/ )
{
print "Illegal instruction in $symbol in ", $File::Find::name, "\n";
}
}
}