若编译内核出现如下情况:
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
GEN .version
CHK include/linux/compile.h
UPD include/linux/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
init/built-in.o: In function `do_one_initcall':
/root/桌面/linux-2.6.30.4/init/main.c:706: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `init_post':
/root/桌面/linux-2.6.30.4/init/main.c:804: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `name_to_dev_t':
/root/桌面/linux-2.6.30.4/init/do_mounts.c:78: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `rest_init':
/root/桌面/linux-2.6.30.4/init/main.c:453: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `calibrate_delay':
/root/桌面/linux-2.6.30.4/init/calibrate.c:123: undefined reference to `__gnu_mcount_nc'
arch/arm/kernel/built-in.o:/root/桌面/linux-2.6.30.4/arch/arm/kernel/elf.c:8: more undefined references to `__gnu_mcount_nc' follow
make: *** [.tmp_vmlinux1] 错误 1
root@:~/桌面/linux-2.6.30.4#
解决方法:
需要补丁__gnu_mcount_nc_patch.patch.gz
具体下载目录在 /2012年资料/2月/11日/Linux内核编译错误/
下载之后放在Linux根目录下,并解压得到:__gnu_mcount_nc_patch.patch 文件。
然后,在终端进入linux根目录,执行以下语句进行打包:zcat __gnu_mcount_nc_patch.patch | patch p1
(注意:“__”为两个下划线连在一起,“p1”后面的是阿拉伯数字1,还要注意空格)