aboutsummaryrefslogtreecommitdiff
path: root/inc2info.pl
diff options
context:
space:
mode:
Diffstat (limited to 'inc2info.pl')
-rw-r--r--inc2info.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/inc2info.pl b/inc2info.pl
new file mode 100644
index 0000000..e6d9153
--- /dev/null
+++ b/inc2info.pl
@@ -0,0 +1,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
+}