4340f1a135bdf60ac5c9e9744ac65a5c15e14798
[coreboot.git] / src / config / linuxbios_c.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                 *(.rodata)
52                 *(.rodata.*)
53                 /*
54                  * kevinh/Ispiri - Added an align, because the objcopy tool
55                  * incorrectly converts sections that are not long word aligned.
56                  * This breaksthe linuxbios.strip target.
57                  */
58                  . = ALIGN(4);
59
60                 _erodata = .;
61         }       
62         /*
63          * After the code we place initialized data (typically initialized
64          * global variables). This gets copied into ram by startup code.
65          * __data_start and __data_end shows where in ram this should be placed,
66          * whereas __data_loadstart and __data_loadend shows where in rom to
67          * copy from.
68          */
69         .data : {
70                 _data = .;
71                 *(.data)
72                 _edata = .;
73         }
74         /*
75          * bss does not contain data, it is just a space that should be zero
76          * initialized on startup. (typically uninitialized global variables)
77          * crt0.S fills between _bss and _ebss with zeroes.
78          */
79         _bss = .;
80         .bss . : {
81                 *(.bss)
82                 *(.sbss)
83                 *(COMMON)
84         }
85         _ebss = .;
86         _end = .;
87         _stack = .;
88         .stack . : {
89                 /* Reserve a stack for each possible cpu, +1 extra */
90                 . = ((MAX_CPUS * STACK_SIZE) + STACK_SIZE) ; 
91         }
92         _estack = .;
93         _heap = .;
94         .heap . : {
95                 /* Reserve 256K for the heap */
96                 . = HEAP_SIZE ;
97                 . = ALIGN(4);
98         }
99         _eheap = .;
100         /* The ram segment
101          * This is all address of the memory resident copy of linuxBIOS.
102          */
103         _ram_seg = _text;
104         _eram_seg = _eheap;
105         /DISCARD/ : {
106                 *(.comment)
107                 *(.note)
108         }
109 }