aboutsummaryrefslogtreecommitdiff
path: root/inc2info.pl
blob: e6d9153c562dd1dd1b77a07d06b0a934f22dae36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl -w

while(<>) {
	chomp;

	s/;.*//;
	next if /^\s*$/;

	($label, $addr) = (/^(\S+)\s+=\s+\$(\S+)/);
	$addr = eval "0x$addr";
	$got{$addr} = $label;
}

for (sort { $a <=> $b } keys %got) {
	$addr = sprintf("%04x", $_);
	print <<EOF;
label { name "$got{$_}"; addr \$$addr; };
EOF
}