aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/boot/compressed/vmlinux.lds
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-12-07 02:14:04 +0100
committerAndi Kleen <andi@basil.nowhere.org>2006-12-07 02:14:04 +0100
commit968de4f02621db35b8ae5239c8cfc6664fb872d8 (patch)
tree9388da7f18f9511e1bbfeaf934cba8dbc696e9f4 /arch/i386/boot/compressed/vmlinux.lds
parentfd593d12770d4a0d1ff095d44b96436c18479ee8 (diff)
downloadlinux-968de4f02621db35b8ae5239c8cfc6664fb872d8.tar.gz
[PATCH] i386: Relocatable kernel support
This patch modifies the i386 kernel so that if CONFIG_RELOCATABLE is selected it will be able to be loaded at any 4K aligned address below 1G. The technique used is to compile the decompressor with -fPIC and modify it so the decompressor is fully relocatable. For the main kernel relocations are generated. Resulting in a kernel that is relocatable with no runtime overhead and no need to modify the source code. A reserved 32bit word in the parameters has been assigned to serve as a stack so we figure out where are running. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/boot/compressed/vmlinux.lds')
-rw-r--r--arch/i386/boot/compressed/vmlinux.lds43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/i386/boot/compressed/vmlinux.lds b/arch/i386/boot/compressed/vmlinux.lds
new file mode 100644
index 0000000000000..cc4854f6c6c1d
--- /dev/null
+++ b/arch/i386/boot/compressed/vmlinux.lds
@@ -0,0 +1,43 @@
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(startup_32)
+SECTIONS
+{
+ /* Be careful parts of head.S assume startup_32 is at
+ * address 0.
+ */
+ . = 0 ;
+ .text.head : {
+ _head = . ;
+ *(.text.head)
+ _ehead = . ;
+ }
+ .data.compressed : {
+ *(.data.compressed)
+ }
+ .text : {
+ _text = .; /* Text */
+ *(.text)
+ *(.text.*)
+ _etext = . ;
+ }
+ .rodata : {
+ _rodata = . ;
+ *(.rodata) /* read-only data */
+ *(.rodata.*)
+ _erodata = . ;
+ }
+ .data : {
+ _data = . ;
+ *(.data)
+ *(.data.*)
+ _edata = . ;
+ }
+ .bss : {
+ _bss = . ;
+ *(.bss)
+ *(.bss.*)
+ *(COMMON)
+ _end = . ;
+ }
+}