6d41cbde8797147d2b8f154470c7aebc0d06f462
[coreboot.git] / src / arch / i386 / init / ldscript_fallback.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         /* cut _start into last 64k*/
47         _x = .;
48         . = (_x < (CONFIG_ROMBASE - 0x10000 +  CONFIG_ROM_IMAGE_SIZE)) ? (CONFIG_ROMBASE - 0x10000 +  CONFIG_ROM_IMAGE_SIZE) : _x;
49
50         /* This section might be better named .setup */
51         .rom . : {
52                 _rom = .;
53                 *(.rom.text);
54                 *(.rom.data);
55                 *(.init.rodata.*);
56                 *(.rodata.*);
57                 *(.rom.data.*);
58                 . = ALIGN(16);
59                 _erom = .;
60         }
61
62         _lrom = LOADADDR(.rom);
63         _elrom = LOADADDR(.rom) + SIZEOF(.rom);
64         _iseg = CONFIG_RAMBASE;
65         _eiseg = _iseg + SIZEOF(.ram);
66         _liseg = _ram;
67         _eliseg = _eram;
68
69         /DISCARD/ : {
70                 *(.comment)
71                 *(.note)
72                 *(.comment.*)
73                 *(.note.*)
74         }
75 }