Makefile: add .c files as prerequisites where needed
[glg-os.git] / linker.ld
blob9aacf37c4840c26e62ced4268802e0632a23627c
1 /* linker.ld
2  *
3  * linker script suitable for kernel development
4  ***********************************************/
6 ENTRY(_start) 
8 SECTIONS
10         /* bootloader conventionally loads the kernel at 1 MiB */
11         . = 1M;
12         
13         /* put the multiboot header first so that the kernel is recognized
14            by the bootloader, then the rest of the text section */
15         .text BLOCK(4K) : ALIGN(4K)
16         {
17                 *(.multiboot)
18                 *(.text)
19         }
21         /* next is the read-only data */
22         .rodata BLOCK(4K) : ALIGN(4K)
23         {
24                 *(.rodata)
25         }
27         /* then, initialized r+w data */
28         .data BLOCK(4K) : ALIGN(4K)
29         {
30                 *(.data)
31         }
33         /*  finally, uninitialized r+w data and stack */
34         .bss BLOCK(4K) : ALIGN(4K)
35         {
36                 *(COMMON)
37                 *(.bss)
38                 *(.bootstrap_stack)
39         }