Skip to content

RFC i386: Relocatable BzImage (V3)

Vivek Goyal lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11i386: Distinguish absolute symbolsarch/i386/kernel/vmlinux.lds.S include/asm-generic/vmlinux.lds.h+63 -560 replies
2/11i386: Remove unnecessary ALIGN() in vmlinux.lds.Sarch/i386/kernel/vmlinux.lds.S+6 -20 replies
3/11i386: Force data segment to be 4K alignedarch/i386/kernel/vmlinux.lds.S+1 -00 replies
4/11i386: define __pa_symbol()include/asm-i386/page.h+3 -00 replies
5/11i386: Reserve kernel memory starting from _textarch/i386/kernel/setup.c+2 -20 replies
6/11i386: CONFIG_PHYSICAL_START cleanuparch/i386/boot/compressed/head.S arch/i386/boot/compressed/misc.c arch/i386/kernel/vmlinux.lds.S +1 more+7 -120 replies
7/11i386: Kallsyms generate relocatable symbolsarch/h8300/kernel/vmlinux.lds.S arch/m68knommu/kernel/vmlinux.lds.S arch/powerpc/kernel/vmlinux.lds.S +5 more+24 -34 replies
8/11i386: Relocatable kernel supportarch/i386/Kconfig arch/i386/Makefile arch/i386/boot/compressed/Makefile +7 more+926 -2160 replies
9/11i386: Warn upon absolute relocations being presentarch/i386/boot/compressed/Makefile arch/i386/boot/compressed/relocs.c+73 -110 replies
10/11i386: Implement CONFIG_PHYSICAL_ALIGNarch/i386/Kconfig arch/i386/boot/compressed/head.S arch/i386/boot/compressed/misc.c +2 more+43 -320 replies
11/11i386: Extend bzImage protocol for relocatable protected mode kernelDocumentation/i386/boot.txt arch/i386/boot/setup.S+16 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/11] i386: Relocatable BzImage (V3)

Hi,

Here is the third attempt on implementing relocatable bzImage for i386. Eric has done all the ground work and I am just giving it final finish. Generated patches against (2.6.19-rc2-git7).

V2 ran into issues with lilo on Andrew's machine. I can't reproduce the problem. For the sake of simpilicity, I have dropped the bit which added and ELF header to bzImage. Instead, I have extended the bzImage protocol to enable boot loaders to load protected mode kernel at a non 1MB address. Hopefully this should not break any existing behaviour.

This functionality is especially useful for kdump where a single kernel can be used both as production kernel and dump capture kernel and distors don't have to maintain an additional kernel just for capturing the dump.

I have tested it with grub (.97) and lilo (lilo 22.7.3).

Note: One has to upgrade the binutils if you want to use
CONFIG_RELOCATABLE=y. Previous ld version will make section relative symbols absolute, if section containing the symbols has zero size. These absolute symbols are not relocated. This issue has been fixed in latest binutils. I am using the one built on 09th octoer 2006 and it works fine for me.

Chages since version V2
----------------------
- Dropped adding and ELF header to bzImage.
- Extended bzImage protocol for relocatable bzImage (version 2.05)
- Added support to display warning message at compilation time if relocations relative to absolute symbols are present.
- Fixed a bug where some intermediate files were not being cleaned up by "make clean"
- Avoid building vmlinux.bin.all if CONFIG_RELOCATABLE is not set.

Looking forward for your suggestions and any test results.

Thanks
Vivek