This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: False syscall dependencies


A quick postscript. I found the dependency tree above using the linker
map produced `ld -M' and a short filter to convert this output to a
form graphviz's dotty could plot. The result is very pleasing. If
anyone's interested I'll post it. In fact, I'll post it anyways. The
usual 'this is ugly ugly one-off Perl code' caveat applies. Please
wear sunglasses.

Cheers,
Shaun

========== ldmdot ==========
#!/usr/bin/perl -w
use strict;

print "digraph ldmap {\n";

while (<>) {
	chomp;
	last if $_ eq '';
}

my $member;
while (<>) {
	chomp;
	last if $_ eq '';
	if (!/^ /) {
		s/^.*\(([^)]*)\).*$/$1/;
		y/-./__/;
		$member = $_;
	} else {
		my $symbol = $_;
		$symbol =~ s/^.*\(([^)]*)\).*$/$1/;
		my $file = $_;
		if (/\) /) {
			$file =~ s/^.*\(([^)]*)\) .*$/$1/;
		} else {
			$file =~ s/^.*(\/| )([^ ]*) .*$/$2/;
		}
		$file =~ y/-./__/;
		print "$file -> $symbol -> $member;\n";
	}
}

print "}\n";


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]