From 878a38bd893a92b5a8d5b5f941cb4ec0c1abeba4 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 4 Sep 2019 19:10:52 +0100 Subject: [PATCH] bin/datasyms: New utility to print the writable-data symbols in object files. It turns out that I have a habit of forgetting to declare constant tables as being `const'. This tool is one of the few ways to notice that I've done this. --- Makefile | 1 + bin/datasyms | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100755 bin/datasyms diff --git a/Makefile b/Makefile index 9899824..85978dd 100644 --- a/Makefile +++ b/Makefile @@ -222,6 +222,7 @@ SCRIPTLINKS += mdw-conf SCRIPTLINKS += svnwrap SCRIPTLINKS += guest-console SCRIPTLINKS += hyperspec +SCRIPTLINKS += datasyms ## Random odds and ends. DOTLINKS += .infokey .sqliterc diff --git a/bin/datasyms b/bin/datasyms new file mode 100755 index 0000000..d54ede6 --- /dev/null +++ b/bin/datasyms @@ -0,0 +1,7 @@ +#! /bin/sh -e +objdump -t "$@" | sed -En ' + /^(.*\.o:) .*$/ { s//\1/; h; } + /(\.data|\.bss|\*COM\*)[[:space:]]+[0-9]+ [^.]/ { + x; /./ p; s/.*//; x + s/^/ /; p + }' -- 2.11.0