慢行者
分类: LINUX
2013-04-22 17:40:10
编译内核文件时候,报如下错误信息:
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
CC /mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.mod.o
LD [M] /mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.ko
make[2]: warning: Clock skew detected. Your build may be incomplete.
make[1]: Leaving directory `/home/thy/ltib/rpm/BUILD/linux-2.6.35.3'
解决办法:
执行:
$ make CONFIG_DEBUG_SECTION_MISMATCH=y
会出现错误的详细信息:
ARCH=arm CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- make -C /home/thy/ltib/rpm/BUILD/linux M=/mnt/hgfs/share/work/lcmxo2-2000hc modules
make[1]: Entering directory `/home/666/ltib/rpm/BUILD/linux-2.6.35.3'
CC [M] /mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.o
Building modules, stage 2.
make[2]: Warning: File `/mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.o' has modification time 0.19 s in the future
MODPOST 1 modules
WARNING: /mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.o(.data+0x4): Section mismatch in reference from the variable mx28_cpld_driver to the function .init.text:mx28_cpld_probe()
The variable mx28_cpld_driver references
the function __init mx28_cpld_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,
WARNING: "mxs_spi_setup" [/mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.ko] undefined!
WARNING: "mxs_spi_transfer" [/mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.ko] undefined!
CC /mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.mod.o
LD [M] /mnt/hgfs/share/work/lcmxo2-2000hc/cpld_lcmxo2-2000hc.ko
make[2]: warning: Clock skew detected. Your build may be incomplete.
make[1]: Leaving directory `/home/thy/ltib/rpm/BUILD/linux-2.6.35.3'
黄色背景字体为问题所在,去掉"__init",将
static int __init mx28_cpld_probe(struct spi_device *spi)
改为:
static int mx28_cpld_probe(struct spi_device *spi)
问题解决