解决编译kernel出现WARNING: modpost: Found 4 section mismatch(es)

板子 helper2416  (cpu s3c2416)
编译kernel 时 版本3.2.11
WARNING: modpost: Found 4 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'

make ARCH=arm CROSS_COMPILE=arm-linux- -j4 CONFIG_DEBUG_SECTION_MISMATCH=y
作者:帅得不敢出门 c/c++群31843264
问题
  LD      drivers/video/built-in.o
WARNING: drivers/video/built-in.o(.text+0x105b8): Section mismatch in reference from the function s3c_fb_init_fbinfo() to the variable .init.data:monspecs
The function s3c_fb_init_fbinfo() references
the variable __initdata monspecs.
This is often because s3c_fb_init_fbinfo lacks a __initdata
annotation or the annotation of monspecs is wrong.

解决
void s3c_fb_init_fbinfo(struct s3c_fb_info *finfo, char *drv_name, int index) 改成
void __init s3c_fb_init_fbinfo(struct s3c_fb_info *finfo, char *drv_name, int index)


问题
WARNING: drivers/video/built-in.o(.data+0x2ac): Section mismatch in reference from the variable s3c_fb_driver to the function .init.text:s3c_fb_probe()
The variable s3c_fb_driver references
the function __init s3c_fb_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

解决
int __init s3c_fb_probe(struct platform_device *pdev)
改成
static int __devinit s3c_fb_probe(struct platform_device *pdev)

问题
WARNING: vmlinux.o(.text+0x101c4): Section mismatch in reference from the function s3c2416_dma_add() to the (unknown reference) .init.data:(unknown)
The function s3c2416_dma_add() references
the (unknown reference) __initdata (unknown).
This is often because s3c2416_dma_add lacks a __initdata
annotation or the annotation of (unknown) is wrong.

解决
static int __init s3c2416_dma_add(struct sys_device *sysdev) //此行加上__init
{
    s3c24xx_dma_init(8, IRQ_S3C2443_DMA0, 0x100);
    return s3c24xx_dma_init_map(&s3c2416_dma_sel);
}

static struct sysdev_driver s3c2416_dma_driver __initdata = { //上行加上__initdata
    .add    = s3c2416_dma_add,
};


  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值