Modify the linker script to match the generated binary
[pintos-anon] / src / threads / kernel.lds.S
1 #include "threads/loader.h"
2
3 OUTPUT_FORMAT("elf32-i386")
4 OUTPUT_ARCH("i386")
5 ENTRY(start)                    /* Kernel starts at "start" symbol. */
6 SECTIONS
7 {
8   /* Specify the kernel base address. */
9   _start = LOADER_PHYS_BASE + LOADER_KERN_BASE;
10
11   /* Make room for the ELF headers. */
12   . = _start + SIZEOF_HEADERS;
13
14   /* Kernel starts with code, followed by read-only data and writable data. */
15   .text : { *(.start) *(.text) } = 0x90
16   .rodata : { *(.rodata) *(.rodata.*) 
17               . = ALIGN(0x1000); 
18               _end_kernel_text = .; }
19   .eh_frame : { *(.eh_frame) }
20   .data : { *(.data) 
21             _signature = .; LONG(0xaa55aa55) }
22
23   .plt : { *(.plt*) }
24
25   /* BSS (zero-initialized data) is after everything else. */
26   _start_bss = .;
27   .bss : { *(.bss) }
28   _end_bss = .;
29
30   _end = .;
31
32   ASSERT (_end - _start <= 512K, "Kernel image is too big.")
33 }