linker script: hax :/
[coreboot.git] / src / arch / x86 / init / bootblock.ld
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2006 Advanced Micro Devices, Inc.
5  * Copyright (C) 2008-2010 coresystems GmbH
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; version 2 of the License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19  */
20
21 /* We use ELF as output format. So that we can debug the code in some form. */
22 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
23 OUTPUT_ARCH(i386)
24
25 TARGET(binary)
26 SECTIONS
27 {
28         . = ROMSTAGE_BASE;
29
30         .rom . : {
31                 _rom = .;
32                 *(.rom.text);
33                 *(.rom.data);
34                 *(.rodata);
35                 *(.rodata.*);
36                 *(.rom.data.*);
37                 . = ALIGN(16);
38                 _erom = .;
39         }
40
41         /DISCARD/ : {
42                 *(.comment)
43                 *(.note)
44                 *(.comment.*)
45                 *(.note.*)
46                 *(.eh_frame);
47         }
48
49         . = CONFIG_DCACHE_RAM_BASE;
50         .car.data . (NOLOAD) : {
51                 *(.car.global_data);
52                 *(.car.cbmem_console);
53         }
54
55         _bogus = ASSERT((SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");
56 /*      _bogus = ASSERT((SIZEOF(.bss) + SIZEOF(.data)) == 0 || CONFIG_AMD_AGESA, "Do not use global variables in romstage");
57  */
58 }