tools/tests/ctor-dtor.pl
author Gregory Szorc <gps@mozilla.com>
Wed, 28 Jan 2015 13:37:00 -0800
branch14_0_Beta_Hedge
changeset 120293 5b81998bb7ab5aade597584417ea90b0995c586e
parent 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rwxr-xr-x
Close old branch 14_0_Beta_Hedge

#!/usr/bin/perl

use Cwd;

$curdir = cwd();

open( LOG, ">ctor-dtor-report" ) || print "can't open $?\n";

@path_fields = split(/\//,$curdir);

$path = join ("/",@path_fields);

print "Searching in " . $path . "\n";
open (REPORT, "find $path -name \"*.o\" -print | xargs nm -Bno | egrep \"_GLOBAL_\.[ID]|_tcf\" 2>&1 |" ) || die "open: $! \n";

while (<REPORT>) {
    print $_;
    print LOG $_;
}
close(REPORT);

if (-s "./ctor-dtor-report" > 0) {
    print "Global Constructors\/Destructors Found" . "\n";
}