michael@0: #!/usr/bin/perl michael@0: michael@0: use Cwd; michael@0: michael@0: $curdir = cwd(); michael@0: michael@0: open( LOG, ">ctor-dtor-report" ) || print "can't open $?\n"; michael@0: michael@0: @path_fields = split(/\//,$curdir); michael@0: michael@0: $path = join ("/",@path_fields); michael@0: michael@0: print "Searching in " . $path . "\n"; michael@0: open (REPORT, "find $path -name \"*.o\" -print | xargs nm -Bno | egrep \"_GLOBAL_\.[ID]|_tcf\" 2>&1 |" ) || die "open: $! \n"; michael@0: michael@0: while () { michael@0: print $_; michael@0: print LOG $_; michael@0: } michael@0: close(REPORT); michael@0: michael@0: if (-s "./ctor-dtor-report" > 0) { michael@0: print "Global Constructors\/Destructors Found" . "\n"; michael@0: }