慢行者
分类: 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)
问题解决