1.平台基本信息
#内核, 4.4.197
Linux hs8145x6 4.4.197 #1 SMP Mon Jul 13 10:01:41 UTC 2020 armv7l GNU/Linux
#cpu, armv7
processor : 0
model name : ARMv7 Processor rev 1 (v7l)
BogoMIPS : 1594.16
Features : half thumb fastmult edsp thumbee tls
#硬件, hisi A9
Hardware : Hisilicon A9
Revision : 0000
Serial : 0000000000000000
2.根据 linux 官网提供的 4.4.197 内核,编译一个最简单的内核模块,提示以下错误
[ 196.377553] ------------[ cut here ]------------
[ 196.377602] WARNING: CPU: 1 PID: 3665 at kernel/module.c:1105 module_put+0x78/0x13c()
[ 196.377615] Modules linked in: getshell bridge ...
[ 196.378513] CPU: 1 PID: 3665 Comm: insmod Tainted: P W O 4.4.197 #1
[ 196.378527] Hardware name: Hisilicon A9
[ 196.378575] [<c0012d3c>] (rtos_unwind_backtrace) from [<c000e518>] (show_stack+0x10/0x14)
[ 196.378611] [<c000e518>] (show_stack) from [<c023cd20>] (dump_stack+0x88/0xa8)
[ 196.378651] [<c023cd20>] (dump_stack) from [<c001fa6c>] (warn_slowpath_common+0x84/0xb0)
[ 196.378678] [<c001fa6c>] (warn_slowpath_common) from [<c001fb80>] (warn_slowpath_null+0x18/0x20)
[ 196.378703] [<c001fb80>] (warn_slowpath_null) from [<c0094140>] (module_put+0x78/0x13c)
[ 196.378730] [<c0094140>] (module_put) from [<c00d5ae4>] (do_init_module+0xd0/0x1e4)
[ 196.378752] [<c00d5ae4>] (do_init_module) from [<c0097648>] (load_module+0x1bc8/0x1c78)
[ 196.378773] [<c0097648>] (load_module) from [<c00978f0>] (SyS_finit_module+0x70/0x94)
[ 196.378794] [<c00978f0>] (SyS_finit_module) from [<c000abc0>] (ret_fast_syscall+0x0/0x40)
[ 196.378811] ---[ end trace d531998291dcf678 ]---
因为机器是双核的,机器内核默认是开启了 PLT section(s), 随便找一个自带的内核模块,用 objdump dump 下 symbol 。可以验证是开启了 PLT 。
[root@hs8145x6 ~]# objdump -t hi_gmac.ko | grep plt
00000000 l d .plt 00000000 .plt
00000001 l d .init.plt 00000000 .init.plt
但是用 linux 官方的内核,且开启了 PLT section(s)情况下编译的模块,无法正常运行。感觉海思好像改了 PLT , 但目前不知道改在哪里, 所以,烦请 有能力的大佬帮忙分析分析下。谢谢。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.