转载:http://blog.chinaunix.net/uid-20799298-id-99670.html
编译内核后使其直接生成uImage,要观察生成过程,使用了如下命令编译:
make O=/tmp/test V=1 uImage > make.log
编译后在/tmp/test下生成了vmlinux
$ ls -sh vmlinux
2.5M vmlinux -------生成的vmlinux 为 2.5M
$ ls -sh arch/arm/boot/
总用量 3.6M
4.0K compressed 1.8M Image 908K uImage 908K zImage
-------生成的uImage与zImage差不多大小,猜想内核编译时生成的
uImage是由zImage生成的。
$ ll arch/arm/boot/
总用量 3656
drwxr-xr-x 2 linux linux 4096 2010-01-15 16:10 compressed
-rwxr-xr-x 1 linux linux 1880568 2010-01-15 16:10 Image
-rw-r--r-- 1 linux linux 926308 2010-01-15 16:10 uImage
-rwxr-xr-x 1 linux linux 926244 2010-01-15 16:10 zImage
-------可以看到uImage比zImage正好大64个字节,即头信息大小
[linux@ test]$ ls -sh vmlinux
2.5M vmlinux ---------顶层下的vmlinux 2.5M
[linux@ test]$ ls -sh arch/arm/boot/compressed/vmlinux
920K arch/arm/boot/compressed/vmlinux
---------arch/arm/boot/compressed下的vmlinux 920K
查看make.log下记录的信息,其中有如下几行
/usr/local/arm/4.3.3/bin/arm-none-linux-gnueabi-ld -EL -p --no-undefined -X -o vmlinux -T arch/arm/kernel/vmlinux.lds arch/arm/kernel/head.o arch/arm/kernel/init_task.o init/built-in.o --start-group usr/built-in.o arch/arm/kernel/built-in.o arch/arm/mm/built-in.o arch/arm/common/built-in.o arch/arm/mach-s3c2410/built-in.o arch/arm/mach-s3c2400/built-in.o arch/arm/mach-s3c2412/built-in.o arch/arm/mach-s3c2440/built-in.o arch/arm/mach-s3c2442/built-in.o arch/arm/mach-s3c2443/built-in.o arch/arm/plat-s3c24xx/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o arch/arm/lib/lib.a lib/lib.a arch/arm/lib/built-in.o lib/built-in.o drivers/built-in.o sound/built-in.o net/built-in.o --end-group |
/usr/local/arm/4.3.3/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,arch/arm/boot/compressed/.head.o.d -nostdinc -isystem /usr/local/arm/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/linux/test/kernel/linux-2.6.22.6/include -include include/linux/autoconf.h -mlittle-endian -D__ASSEMBLY__ -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=4 -march=armv4t -mtune=arm9tdmi -msoft-float -c -o arch/arm/boot/compressed/head.o /home/linux/test/kernel/linux-2.6.22.6/arch/arm/boot/compressed/head.S |
/usr/local/arm/4.3.3/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,arch/arm/boot/compressed/.piggy.o.d -nostdinc -isystem /usr/local/arm/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/linux/test/kernel/linux-2.6.22.6/include -include include/linux/autoconf.h -mlittle-endian -D__ASSEMBLY__ -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=4 -march=armv4t -mtune=arm9tdmi -msoft-float -c -o arch/arm/boot/compressed/piggy.o /home/linux/test/kernel/linux-2.6.22.6/arch/arm/boot/compressed/piggy.S |
/usr/local/arm/4.3.3/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,arch/arm/boot/compressed/.misc.o.d -nostdinc -isystem /usr/local/arm/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/linux/test/kernel/linux-2.6.22.6/include -include include/linux/autoconf.h -mlittle-endian -I/home/linux/test/kernel/linux-2.6.22.6/arch/arm/boot/compressed -Iarch/arm/boot/compressed -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=4 -march=armv4t -mtune=arm9tdmi -msoft-float -Uarm -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -fpic -Dstatic= -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(misc)" -D"KBUILD_MODNAME=KBUILD_STR(misc)" -c -o arch/arm/boot/compressed/misc.o /home/linux/test/kernel/linux-2.6.22.6/arch/arm/boot/compressed/misc.c |
/usr/local/arm/4.3.3/bin/arm-none-linux-gnueabi-ld -EL --defsym zreladdr=0x30008000 --defsym params_phys=0x30000100 -p --no-undefined -X /usr/local/arm/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/armv4t/libgcc.a -T arch/arm/boot/compressed/vmlinux.lds arch/arm/boot/compressed/head.o arch/arm/boot/compressed/piggy.o arch/arm/boot/compressed/misc.o -o arch/arm/boot/compressed/vmlinux |