backported fixes from 256boss:
[bootcensus] / pcboot.ld
1 OUTPUT_ARCH(i386)
2
3 SECTIONS {
4         /* BIOS loads the boot code at 0000:7c00 */
5         . = 0x7c00;
6
7         .boot : { * (.boot); }
8
9         /* second stage boot loader */
10         .boot2 : {
11                 * (.boot2);
12                 /* pad the boot loader to the next sector boundary */
13                 . = ALIGN(512);
14         }
15         _boot2_size = SIZEOF(.boot2);
16
17         /* main program will be loaded at 1MB by the second stage
18          * boot loader
19          */
20         . = 1M;
21         _main_start = .;
22
23         .startup : { * (.startup); }
24         .text : { * (.text); }
25         .rodata : { * (.rodata); }
26         .data : { * (.data); }
27
28         .bss ALIGN(4): {
29                 _bss_start = .;
30                 * (.bss);
31                 . = ALIGN(4);
32                 _bss_end = .;
33         }
34         _bss_size = SIZEOF(.bss);
35
36         _main_size = . - _main_start;
37         _mem_start = .;
38 }