V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
guanyin9cn
V2EX  ›  程序员

收集 海思 Linux kernel 模块 开发交流的渠道。被 module PLT section(s) missing,困扰好久了。

  •  
  •   guanyin9cn · 2021-09-12 17:30:02 +08:00 · 1189 次点击
    这是一个创建于 946 天前的主题,其中的信息可能已经有所发展或是发生改变。

    RT, 之前询问的帖子,www.v2ex.com/t/786837

    编译成的 ko 模块 (github.com/0neday/OptiXstarHS8145X6/tree/main/persist-root-shell),在海思中运行提示 错误。

    module PLT section(s) missing
    

    修改 linux 官方内核 4.4.197 中 arch/arm/kernel/module.lds 的内容,去掉 .core

    SECTIONS {
    .plt : { BYTE(0) }
    .init.plt : { BYTE(0) }
    }
    

    运行不提示错误,用lsmod 查看,模块没有加载成功,状态 -1 。

    这个问题困扰好久了。 应该需要给内核打补丁。

    第 1 条附言  ·  2021-09-13 09:51:58 +08:00

    symbol

    [root@haproxy persist-root-shell]# objdump  -t getshell.ko
    
    getshell.ko:     file format elf32-little
    
    SYMBOL TABLE:
     d  .core.plt     .core.plt
     d  .init.plt      .init.plt
    
    第 2 条附言  ·  2021-09-13 13:38:43 +08:00

    dmesg

    [  196.377553] ------------[ cut here ]------------
    [  196.377602] WARNING: CPU: 1 PID: 3665 at kernel/module.c:1105 module_put+0x78/0x13c()
    
    

    查看 module.c 1105 row, 加载 module 失败。

    bool try_module_get(struct module *module)
    {
    	bool ret = true;
    
    	if (module) {
    		preempt_disable();
    		/* Note: here, we can fail to get a reference */
    		if (likely(module_is_live(module) &&
    			   atomic_inc_not_zero(&module->refcnt) != 0))
    			trace_module_get(module, _RET_IP_);
    		else
    			ret = false;
    
    		preempt_enable();
    	}
    	return ret;
    }
    
    

    elixir.bootlin.com/linux/v4.4.197/source/kernel/module.c#L1105

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5604 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:53 · PVG 13:53 · LAX 22:53 · JFK 01:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.