initial commit
[mit-jos.git] / kern / kernel.ld
blob16a450514fa0e278c4c0932e0e6f6840b2ba07e0
1 /* Simple linker script for the JOS kernel.
2    See the GNU ld 'info' manual ("info ld") to learn the syntax. */
4 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
5 OUTPUT_ARCH(i386)
6 ENTRY(_start)
8 SECTIONS
10         /* Load the kernel at this address: "." means the current address */
11         . = 0xF0100000;
13         .text : {
14                 *(.text .stub .text.* .gnu.linkonce.t.*)
15         }
17         PROVIDE(etext = .);     /* Define the 'etext' symbol to this value */
19         .rodata : {
20                 *(.rodata .rodata.* .gnu.linkonce.r.*)
21         }
23         /* Include debugging information in kernel memory */
24         .stab : {
25                 PROVIDE(__STAB_BEGIN__ = .);
26                 *(.stab);
27                 PROVIDE(__STAB_END__ = .);
28                 BYTE(0)         /* Force the linker to allocate space
29                                    for this section */
30         }
32         .stabstr : {
33                 PROVIDE(__STABSTR_BEGIN__ = .);
34                 *(.stabstr);
35                 PROVIDE(__STABSTR_END__ = .);
36                 BYTE(0)         /* Force the linker to allocate space
37                                    for this section */
38         }
40         /* Adjust the address for the data segment to the next page */
41         . = ALIGN(0x1000);
43         /* The data segment */
44         .data : {
45                 *(.data)
46         }
48         PROVIDE(edata = .);
50         .bss : {
51                 *(.bss)
52         }
54         PROVIDE(end = .);
56         /DISCARD/ : {
57                 *(.eh_frame .note.GNU-stack)
58         }