From d963772c6633a0610898aaba2ae90d461e8f2de8 Mon Sep 17 00:00:00 2001 From: nishi Date: Fri, 7 Jul 2023 23:40:27 +0000 Subject: should be working, should be git-svn-id: https://svn.vegaa.systems/svn/vega-Vega/trunk@7 a8a8aea2-181d-ee11-89e8-15fd0e089fc4 --- tools/ksyms | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 tools/ksyms (limited to 'tools/ksyms') diff --git a/tools/ksyms b/tools/ksyms new file mode 100755 index 0000000..f09203f --- /dev/null +++ b/tools/ksyms @@ -0,0 +1,10 @@ +#!/bin/bash +# $Id$ + +rm -f $1 +printf "#include \n\nstruct kernel_symbol" > $1 +printf " {\n\tuint64_t addr;\n\tchar* name;\n};\n\n" >> $1 +printf "const struct kernel_symbol g_ksym_table[] = {\n" >> $1 +nm $2 | grep " [tT] " | awk '{ print " { .addr = 0x"$1", .name = \""$3"\" }," }' | sort >> $1 +printf " { .addr = (size_t)-1, .name = \"\" }\n};\n\n" >> $1 +printf "const int ksym_elem_count = sizeof(g_ksym_table) / sizeof(*g_ksym_table);\n" >> $1 -- cgit v1.2.3