OpenHarmony开发者论坛

标题: 内核编译告警Section mismatch in reference from the variable __ksymtab_rockchip_clk_register_armclk to the function .init.text:rockchip_clk_register_armclk() [打印本页]

作者: 润开鸿_闻飞    时间: 6 天前
标题: 内核编译告警Section mismatch in reference from the variable __ksymtab_rockchip_clk_register_armclk to the function .init.text:rockchip_clk_register_armclk()
[md]【问题描述】:<br />
内核编译告警出现以下告警<br />

![image](https://192.168.3.50:8088/gitlab ... 34de26a1b/image.png)

```
[OHOS ERROR] WARNING: modpost: vmlinux.o(___ksymtab_gpl+rockchip_clk_register_armclk+0x0): Section mismatch in reference from the variable __ksymtab_rockchip_clk_register_armclk to the function .init.text:rockchip_clk_register_armclk()
[OHOS ERROR] The symbol rockchip_clk_register_armclk is exported and annotated __init
[OHOS ERROR] Fix this by removing the __init annotation of rockchip_clk_register_armclk or drop the export.
```

【问题分析】:<br />
函数申明/定义的时候加了__init作用域同时该函数又通过EXPORT_SYMBOL_GPL将该函数导出,从而导致两者的生命周期时间不一致
【问题处理】:<br />
将函数申明/定义中的__init删除或者将EXPORT_SYMBOL_GPL导出删除
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5