注意:以下内容均在64位archlinux上操作,其它系统类似
原因是编译时Kernel的源文件“system.tmp”文件写入了大量的空白段,可能原名是.note,但使用readelf system.tem显示的段是.note.gnu.property。
所以在Makefile中的43行的objcopy处,加上 -R .note.gnu.property。原来写的是-R .note,推测Makefile希望删除的应该是.note段,所以把Makefile中的43行-R .note换成-R .note.gnu.property。
这部分如下:
Image: boot/bootsect boot/setup tools/system tools/build
cp -f tools/system system.tmp
strip system.tmp
objcopy -O binary -R .note -R .comment -R .note.gnu.property system.tmp tools/kernel //改变的部分
tools/build boot/bootsect boot/setup tools/kernel $(ROOT_DEV) > Image
rm system.tmp
rm tools/kernel -f
sync