#!/local/bin/perl

foreach $objfile (@ARGV) {
    open(PIPE, "nm $objfile|");

    local(@Usymbols, @Dsymbols);
    while ($_=<PIPE>) {
	next unless /^[0-9a-f]{8} (.) /i;
	local($code, $symbol) = ($1, $');
	if ($code eq "U") {
	    push(@Usymbols, $symbol);
	} else if ($code eq "T" || $code eq "D") {
	    push(@Dsymbols, $symbol);
	} elseif (!$OLDUNKNOWN{$code}) {
	    print "Unknown code $code\n";
	    $OLDUNKNOWN{$code} = 1;
	}
    }
}
