]> git.ipfire.org Git - people/ms/u-boot.git/blob - arch/powerpc/cpu/ppc4xx/u-boot.lds
xilinx-ppc4xx-generic: Use common u-boot.lds
[people/ms/u-boot.git] / arch / powerpc / cpu / ppc4xx / u-boot.lds
1 /*
2 * Copyright 2007-2009 Freescale Semiconductor, Inc.
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23 #include "config.h" /* CONFIG_BOARDDIR */
24
25 #ifndef RESET_VECTOR_ADDRESS
26 #ifdef CONFIG_RESET_VECTOR_ADDRESS
27 #define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS
28 #else
29 #define RESET_VECTOR_ADDRESS 0xfffffffc
30 #endif
31 #endif
32
33 OUTPUT_ARCH(powerpc)
34
35 PHDRS
36 {
37 text PT_LOAD;
38 bss PT_LOAD;
39 }
40
41 SECTIONS
42 {
43 /* Read-only sections, merged into text segment: */
44 . = + SIZEOF_HEADERS;
45 .text :
46 {
47 *(.text*)
48 } :text
49 _etext = .;
50 PROVIDE (etext = .);
51 .rodata :
52 {
53 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
54 } :text
55
56 /* Read-write section, merged into data segment: */
57 . = (. + 0x00FF) & 0xFFFFFF00;
58 _erotext = .;
59 PROVIDE (erotext = .);
60 .reloc :
61 {
62 KEEP(*(.got))
63 _GOT2_TABLE_ = .;
64 KEEP(*(.got2))
65 _FIXUP_TABLE_ = .;
66 KEEP(*(.fixup))
67 }
68 __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
69 __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
70
71 .data :
72 {
73 *(.data*)
74 *(.sdata*)
75 }
76 _edata = .;
77 PROVIDE (edata = .);
78
79 . = .;
80 __u_boot_cmd_start = .;
81 .u_boot_cmd : { *(.u_boot_cmd) }
82 __u_boot_cmd_end = .;
83
84 . = .;
85 __start___ex_table = .;
86 __ex_table : { *(__ex_table) }
87 __stop___ex_table = .;
88
89 . = ALIGN(256);
90 __init_begin = .;
91 .text.init : { *(.text.init) }
92 .data.init : { *(.data.init) }
93 . = ALIGN(256);
94 __init_end = .;
95
96 #ifdef CONFIG_440
97 .bootpg RESET_VECTOR_ADDRESS - 0xffc :
98 {
99 arch/powerpc/cpu/ppc4xx/start.o (.bootpg)
100
101 /*
102 * PPC440 board need a board specific object with the
103 * TLB definitions. This needs to get included right after
104 * start.o, since the first shadow TLB only covers 4k
105 * of address space.
106 */
107 #ifdef CONFIG_INIT_TLB
108 CONFIG_INIT_TLB (.bootpg)
109 #else
110 CONFIG_BOARDDIR/init.o (.bootpg)
111 #endif
112 } :text = 0xffff
113 #endif
114
115 .resetvec RESET_VECTOR_ADDRESS :
116 {
117 KEEP(*(.resetvec))
118 } :text = 0xffff
119
120 . = RESET_VECTOR_ADDRESS + 0x4;
121
122 /*
123 * Make sure that the bss segment isn't linked at 0x0, otherwise its
124 * address won't be updated during relocation fixups. Note that
125 * this is a temporary fix. Code to dynamically the fixup the bss
126 * location will be added in the future. When the bss relocation
127 * fixup code is present this workaround should be removed.
128 */
129 #if (RESET_VECTOR_ADDRESS == 0xfffffffc)
130 . |= 0x10;
131 #endif
132
133 __bss_start = .;
134 .bss (NOLOAD) :
135 {
136 *(.bss*)
137 *(.sbss*)
138 *(COMMON)
139 } :bss
140
141 . = ALIGN(4);
142 _end = . ;
143 PROVIDE (end = .);
144 }