解決編譯kernel出現WARNING: modpost: Found 4 section mismatch(es)

來源:互聯網
上載者:User
板子 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,
};


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.