- To reduce confuse rename the parts of linuxbios bios that run from
[coreboot.git] / src / config / linuxbios_ram.ld
1 /*
2  *      Memory map:
3  *
4  *      _RAMBASE                
5  *                              : data segment
6  *                              : bss segment
7  *                              : heap
8  *                              : stack
9  */
10 /*
11  * Bootstrap code for the STPC Consumer
12  * Copyright (c) 1999 by Net Insight AB. All Rights Reserved.
13  */
14
15 /*
16  *      Written by Johan Rydberg, based on work by Daniel Kahlin.
17  *      Rewritten by Eric Biederman
18  */
19 /*
20  *      We use ELF as output format. So that we can
21  *      debug the code in some form. 
22  */
23 INCLUDE ldoptions
24
25 ENTRY(_start)
26
27 SECTIONS
28 {
29         . = _RAMBASE;
30         /*
31          * First we place the code and read only data (typically const declared).
32          * This get placed in rom.
33          */
34         .text : {
35                 _text = .;
36                 *(.text);
37                 *(.text.*);
38                 . = ALIGN(16);
39                 _etext = .;
40         }
41         .rodata : {
42                 _rodata = .;
43                 . = ALIGN(4);
44                 console_drivers = .;
45                 *(.rodata.console_drivers)
46                 econsole_drivers = . ;
47                 . = ALIGN(4);
48                 pci_drivers = . ;
49                 *(.rodata.pci_driver)
50                 epci_drivers = . ;
51                 cpu_drivers = . ;
52                 *(.rodata.cpu_driver)
53                 ecpu_drivers = . ;
54                 *(.rodata)
55                 *(.rodata.*)
56                 /*
57                  * kevinh/Ispiri - Added an align, because the objcopy tool
58                  * incorrectly converts sections that are not long word aligned.
59                  * This breaksthe linuxbios.strip target.
60                  */
61                  . = ALIGN(4);
62
63                 _erodata = .;
64         }       
65         /*
66          * After the code we place initialized data (typically initialized
67          * global variables). This gets copied into ram by startup code.
68          * __data_start and __data_end shows where in ram this should be placed,
69          * whereas __data_loadstart and __data_loadend shows where in rom to
70          * copy from.
71          */
72         .data : {
73                 _data = .;
74                 *(.data)
75                 _edata = .;
76         }
77         /*
78          * bss does not contain data, it is just a space that should be zero
79          * initialized on startup. (typically uninitialized global variables)
80          * crt0.S fills between _bss and _ebss with zeroes.
81          */
82         _bss = .;
83         .bss . : {
84                 *(.bss)
85                 *(.sbss)
86                 *(COMMON)
87         }
88         _ebss = .;
89         _end = .;
90         . = ALIGN(STACK_SIZE);
91         _stack = .;
92         .stack . : {
93                 /* Reserve a stack for each possible cpu */
94                 . = (CONFIG_MAX_CPUS * STACK_SIZE) ;
95         }
96         _estack = .;
97         _heap = .;
98         .heap . : {
99                 /* Reserve 256K for the heap */
100                 . = HEAP_SIZE ;
101                 . = ALIGN(4);
102         }
103         _eheap = .;
104         /* The ram segment
105          * This is all address of the memory resident copy of linuxBIOS.
106          */
107         _ram_seg = _text;
108         _eram_seg = _eheap;
109         /DISCARD/ : {
110                 *(.comment)
111                 *(.note)
112                 *(.note.*)
113         }
114 }