9cb2978c5d42970db590505d1676018d672aceea
[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  * $Id$
15  *
16  */
17
18 /*
19  *      Written by Johan Rydberg, based on work by Daniel Kahlin.
20  *      Rewritten by Eric Biederman
21  */
22 /*
23  *      We use ELF as output format. So that we can
24  *      debug the code in some form. 
25  */
26 INCLUDE ldoptions
27
28 ENTRY(_start)
29
30 SECTIONS
31 {
32         . = _RAMBASE;
33         /*
34          * First we place the code and read only data (typically const declared).
35          * This get placed in rom.
36          */
37         .text : {
38                 _text = .;
39                 *(.text);
40                 *(.text.*);
41                 . = ALIGN(16);
42                 _etext = .;
43         }
44         .rodata : {
45                 _rodata = .;
46                 . = ALIGN(4);
47                 console_drivers = .;
48                 *(.rodata.console_drivers)
49                 econsole_drivers = . ;
50                 . = ALIGN(4);
51                 pci_drivers = . ;
52                 *(.rodata.pci_driver)
53                 epci_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         _stack = .;
91         .stack . : {
92                 /* Reserve a stack for each possible cpu, +1 extra */
93                 . = ((MAX_CPUS * STACK_SIZE) + STACK_SIZE) ; 
94         }
95         _estack = .;
96         _heap = .;
97         .heap . : {
98                 /* Reserve 256K for the heap */
99                 . = HEAP_SIZE ;
100                 . = ALIGN(4);
101         }
102         _eheap = .;
103         /* The ram segment
104          * This is all address of the memory resident copy of linuxBIOS.
105          */
106         _ram_seg = _text;
107         _eram_seg = _eheap;
108         /DISCARD/ : {
109                 *(.comment)
110                 *(.note)
111         }
112 }