aboutsummaryrefslogtreecommitdiff
path: root/tools/ksyms
diff options
context:
space:
mode:
authornishi <nishi@vegaa.systems>2023-07-07 23:40:27 +0000
committernishi <nishi@vegaa.systems>2023-07-07 23:40:27 +0000
commitd963772c6633a0610898aaba2ae90d461e8f2de8 (patch)
tree64d9e0a7b09b205d5f42011aa2bfe88e321f706d /tools/ksyms
should be working, should be
git-svn-id: https://svn.vegaa.systems/svn/vega-Vega/trunk@7 a8a8aea2-181d-ee11-89e8-15fd0e089fc4
Diffstat (limited to 'tools/ksyms')
-rwxr-xr-xtools/ksyms10
1 files changed, 10 insertions, 0 deletions
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 <sys/types.h>\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