- To reduce confuse rename the parts of linuxbios bios that run from
[coreboot.git] / src / arch / ppc / init / ldscript.lb
1 /*
2  *      Memory map:
3  *
4  *      _ROMBASE                : start of ROM
5  *      _RESET                  : reset vector (may be at top of ROM)
6  *      _EXCEPTIONS_VECTORS     : exception table
7  *
8  *      _ROMSTART               : linuxbios text 
9  *                              : payload text
10  *
11  *      _RAMBASE                : address to copy payload
12  */
13
14 /*
15  *      Written by Johan Rydberg, based on work by Daniel Kahlin.
16  *      Rewritten by Eric Biederman
17  *      Re-rewritten by Greg Watson for PPC
18  */
19
20 /*
21  *      We use ELF as output format. So that we can
22  *      debug the code in some form. 
23  */
24
25 OUTPUT_FORMAT("elf32-powerpc")
26 ENTRY(_start)
27
28 TARGET(binary)
29 INPUT(linuxbios_ram.rom)
30 SECTIONS
31 {
32         /* 
33          * Absolute location of base of ROM 
34          */
35         . = _ROMBASE;
36
37         /*
38          * Absolute location of reset vector. This may actually be at the
39          * the top of ROM.
40          */
41         . = _RESET;
42         .reset . : {
43                 *(.rom.reset);
44                 . = ALIGN(16);
45         }
46
47         /*
48          * Absolute location of exception vector table.
49          */
50         . = _EXCEPTION_VECTORS;
51         .exception_vectors . : {
52                 *(.rom.exception_vectors);
53                 . = ALIGN(16);
54         }
55
56         /*
57          * Absolute location of LinuxBIOS initialization code in ROM.
58          */
59         . = _ROMSTART;
60         .rom . : {
61                 _rom = .;
62                 *(.rom.text);
63                 *(.text);
64                 *(.rom.data);
65                 *(.rodata);
66                 *(EXCLUDE_FILE(linuxbios_ram.rom) .data);
67                 . = ALIGN(16);
68                 _erom = .;
69         }
70         _lrom = LOADADDR(.rom);
71         _elrom = LOADADDR(.rom) + SIZEOF(.rom);
72         
73         /*
74          * Ram is the LinuxBIOS code that runs from RAM.
75          */
76         .ram . : {
77                 _ram = . ;
78                 linuxbios_ram.rom(*)
79                 _eram = . ;
80         }
81
82         /*
83          * Absolute location of where LinuxBIOS will be relocated in RAM.
84          */
85         _iseg = _RAMBASE;
86         _eiseg = _iseg + SIZEOF(.ram);
87         _liseg = _ram;
88         _eliseg = _eram;
89
90         /DISCARD/ : {
91                 *(.comment)
92                 *(.note)
93         }
94 }