若編譯核心出現如下情況:
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@czu:~/案頭/linux-2.6.30.4#
解決方案:
需要補丁__gnu_mcount_nc_patch.patch.gz
下載之後放在linux根目錄下,並解壓得到:__gnu_mcount_nc_patch.patch 檔案。
然後,在終端進入linux根目錄,執行以下語句進行打包:zcat __gnu_mcount_nc_patch.patch | patch p1
(注意:“__”為兩個底線連在一起,“p1”後面的是阿拉伯數字1,還要注意空格)
更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/