⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ksyms.sh

📁 Linux 1.0 内核C源代码 Linux最早版本代码 由Linus Torvalds亲自书写的
💻 SH
字号:
# This program will construct ksyms.s.  Ksyms.s contains a symbol table
# for all the kernel symbols included in the file ksyms.lst.  The following
# variables are defined in ksym.s:
#
#	int symbol_table_size;		/* number of symbols */
#	struct {
#		void *value;		/* value of symbol */
#		char *name;		/* name of symbol */
#	} symbol_table[];
#
#

trap "rm -f ksyms.tmp ksyms.lst ; exit 1" 1 2 

sed -e '/^#/d' -e '/^[	 ]*$/d' ksyms.lst | sort > ksyms.tmp

echo '	.data
	.globl	_symbol_table_size, _symbol_table

_symbol_table_size:'
echo "	.long" `wc -l < ksyms.tmp`
echo '
_symbol_table:'
awk 'BEGIN {stringloc = 0}
{print "	.long " $1; print "	.long strings+" stringloc; \
        stringloc += length($1) + 1;}' ksyms.tmp
echo '
strings:'
awk '{print "	.ascii \"" $1 "\\0\""}' ksyms.tmp
rm -f ksyms.tmp


#
# Alternativly, if the kernel is c++ compiled:
# By using gsub() we can forse all function names to appear as extern "C".
# This allows linkable drivers written in C or C++ - Jon
# awk '{gsub(/__F.*/, "") ; print "	.ascii \"" $0 "\\0\""}' ksyms.tmp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -