0ed5c47f53d03be9a233039347aa90a7fc805c28
[coreboot.git] / src / arch / i386 / init / ldscript.lb
1 /*
2  *      Memory map:
3  *
4  *      CONFIG_RAMBASE          
5  *                              : data segment
6  *                              : bss segment
7  *                              : heap
8  *                              : stack
9  *      CONFIG_ROMBASE
10  *                              : coreboot text 
11  *                              : readonly text
12  */
13 /*
14  * Bootstrap code for the STPC Consumer
15  * Copyright (c) 1999 by Net Insight AB. All Rights Reserved.
16  *
17  */
18
19 /*
20  *      Written by Johan Rydberg, based on work by Daniel Kahlin.
21  *      Rewritten by Eric Biederman
22  */
23 /*
24  *      We use ELF as output format. So that we can
25  *      debug the code in some form. 
26  */
27 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
28 OUTPUT_ARCH(i386)
29
30 /*
31 ENTRY(_start)
32 */
33
34 TARGET(binary)
35 INPUT(coreboot_ram.rom)
36 SECTIONS
37 {
38         . = CONFIG_ROMBASE;
39
40         .ram . : {
41                 _ram = . ;
42                 coreboot_ram.rom(*)
43                 _eram = . ;
44         }
45
46         /* This section might be better named .setup */
47         .rom . : {
48                 _rom = .;
49                 *(.rom.text);
50                 *(.rom.data);
51                 *(.rodata.*);
52                 *(.rom.data.*);
53                 . = ALIGN(16);
54                 _erom = .;
55         }
56
57         _lrom = LOADADDR(.rom);
58         _elrom = LOADADDR(.rom) + SIZEOF(.rom);
59         _iseg = CONFIG_RAMBASE;
60         _eiseg = _iseg + SIZEOF(.ram);
61         _liseg = _ram;
62         _eliseg = _eram;
63
64         /DISCARD/ : {
65                 *(.comment)
66                 *(.comment.*)
67                 *(.note)
68                 *(.note.*)
69         }
70 }