summaryrefslogtreecommitdiff
path: root/src/arch/ppc/init/ldscript.lb
blob: a81d9b9bb8c661f718624fdc9ab42efd284f2a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 *	Memory map:
 *
 *	_ROMBASE		: start of ROM
 *	_RESET			: reset vector (may be at top of ROM)
 *	_EXCEPTIONS_VECTORS	: exception table
 *
 *	_ROMSTART 		: coreboot text 
 *				: payload text
 *
 *	_RAMBASE		: address to copy payload
 */

/*
 *	Written by Johan Rydberg, based on work by Daniel Kahlin.
 *      Rewritten by Eric Biederman
 *	Re-rewritten by Greg Watson for PPC
 */

/*
 *	We use ELF as output format. So that we can
 *	debug the code in some form. 
 */

OUTPUT_FORMAT("elf32-powerpc")
ENTRY(_start)

TARGET(binary)
INPUT(coreboot_ram.rom)
SECTIONS
{
	/* 
	 * Absolute location of base of ROM 
	 */
	. = _ROMBASE;

	/*
	 * Absolute location of reset vector. This may actually be at the
	 * the top of ROM.
	 */
	. = _RESET;
	.reset . : {
		*(.rom.reset);
		. = ALIGN(16);
	}

	/*
	 * Absolute location of exception vector table.
	 */
	. = _EXCEPTION_VECTORS;
	.exception_vectors . : {
		*(.rom.exception_vectors);
		. = ALIGN(16);
	}

	/*
	 * Absolute location of coreboot initialization code in ROM.
	 */
	. = _ROMSTART;
	.rom . : {
		_rom = .;
		*(.rom.text);
		*(.text);
		*(.rom.data);
		*(.rodata);
		*(EXCLUDE_FILE(coreboot_ram.rom) .data);
		. = ALIGN(16);
		_erom = .;
	}
	_lrom = LOADADDR(.rom);
	_elrom = LOADADDR(.rom) + SIZEOF(.rom);
	
	/*
	 * Ram is the coreboot code that runs from RAM.
	 */
	.ram . : {
		_ram = . ;
		coreboot_ram.rom(*)
		_eram = . ;
	}

	.sdata : {
		_SDA_BASE_ = .;
		*(.sdata)
	}

	.sdata2 : {
		_SDA2_BASE_ = .;
		*(.sdata2)
	}



	/*
	 * Absolute location of where coreboot will be relocated in RAM.
	 */
	_iseg = _RAMBASE;
	_eiseg = _iseg + SIZEOF(.ram);
	_liseg = _ram;
	_eliseg = _eram;

	/DISCARD/ : {
		*(.comment)
		*(.note)
	}
}