initial import
[patches.git] / u-boot-cpp-linker-script.patch
1 Index: config.mk
2 ===================================================================
3 --- config.mk (revision 608)
4 +++ config.mk (working copy)
5 @@ -182,7 +182,7 @@
6
7 AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
8
9 -LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
10 +LDFLAGS += -Bstatic -T $(LDSCRIPT) $(PLATFORM_LDFLAGS)
11
12 # Location of a usable BFD library, where we define "usable" as
13 # "built for ${HOST}, supports ${TARGET}". Sensible values are
14 Index: Makefile
15 ===================================================================
16 --- Makefile (revision 608)
17 +++ Makefile (working copy)
18 @@ -2299,6 +2299,7 @@
19 rm -f $(obj)tools/env/fw_printenv $(obj)tools/env/fw_setenv
20 rm -f $(obj)tools/bin2ldr/app.bin $(obj)tools/bin2ldr/app.hex $(obj)tools/bin2ldr/app.ldr
21 rm -f $(obj)tools/bin2ldr/init_sdram* $(obj)tools/bin2ldr/jump $(obj)tools/bin2ldr/bin2ldr
22 + rm -f $(obj)board/bf*/u-boot.lds
23 rm -f $(obj)board/cray/L1/bootscript.c $(obj)board/cray/L1/bootscript.image
24 rm -f $(obj)board/netstar/eeprom $(obj)board/netstar/crcek $(obj)board/netstar/crcit
25 rm -f $(obj)board/netstar/*.srec $(obj)board/netstar/*.bin
26 Index: board/bf537-stamp/u-boot.lds
27 ===================================================================
28 --- board/bf537-stamp/u-boot.lds (revision 608)
29 +++ board/bf537-stamp/u-boot.lds (working copy)
30 @@ -1,188 +0,0 @@
31 -/*
32 - * U-boot - u-boot.lds
33 - *
34 - * Copyright (c) 2005 blackfin.uclinux.org
35 - *
36 - * (C) Copyright 2000-2004
37 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
38 - *
39 - * See file CREDITS for list of people who contributed to this
40 - * project.
41 - *
42 - * This program is free software; you can redistribute it and/or
43 - * modify it under the terms of the GNU General Public License as
44 - * published by the Free Software Foundation; either version 2 of
45 - * the License, or (at your option) any later version.
46 - *
47 - * This program is distributed in the hope that it will be useful,
48 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
49 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 - * GNU General Public License for more details.
51 - *
52 - * You should have received a copy of the GNU General Public License
53 - * along with this program; if not, write to the Free Software
54 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
55 - * MA 02111-1307 USA
56 - */
57 -
58 -OUTPUT_ARCH(bfin)
59 -SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
60 -/* Do we need any of these for elf?
61 - __DYNAMIC = 0; */
62 -MEMORY
63 - {
64 - ram : ORIGIN = 0x03FC0000, LENGTH = (256 * 1024)
65 - l1_code : ORIGIN = 0xFFA00000, LENGTH = 0xC000
66 - l1_data : ORIGIN = 0xFF900000, LENGTH = 0x4000
67 - }
68 -
69 -SECTIONS
70 -{
71 - /* Read-only sections, merged into text segment: */
72 - . = + SIZEOF_HEADERS; /*0x1000;*/
73 - .interp : { *(.interp) }
74 - .hash : { *(.hash) }
75 - .dynsym : { *(.dynsym) }
76 - .dynstr : { *(.dynstr) }
77 - .rel.text : { *(.rel.text) }
78 - .rela.text : { *(.rela.text) }
79 - .rel.data : { *(.rel.data) }
80 - .rela.data : { *(.rela.data) }
81 - .rel.rodata : { *(.rel.rodata) }
82 - .rela.rodata : { *(.rela.rodata) }
83 - .rel.got : { *(.rel.got) }
84 - .rela.got : { *(.rela.got) }
85 - .rel.ctors : { *(.rel.ctors) }
86 - .rela.ctors : { *(.rela.ctors) }
87 - .rel.dtors : { *(.rel.dtors) }
88 - .rela.dtors : { *(.rela.dtors) }
89 - .rel.bss : { *(.rel.bss) }
90 - .rela.bss : { *(.rela.bss) }
91 - .rel.plt : { *(.rel.plt) }
92 - .rela.plt : { *(.rela.plt) }
93 - .init : { *(.init) }
94 - .plt : { *(.plt) }
95 - .text :
96 - {
97 - /* WARNING - the following is hand-optimized to fit within */
98 - /* the sector before the environment sector. If it throws */
99 - /* an error during compilation remove an object here to get */
100 - /* it linked after the configuration sector. */
101 -
102 - cpu/bf537/start.o (.text)
103 - cpu/bf537/start1.o (.text)
104 - cpu/bf537/traps.o (.text)
105 - cpu/bf537/interrupt.o (.text)
106 - cpu/bf537/serial.o (.text)
107 - common/dlmalloc.o (.text)
108 -/* lib_blackfin/bf533_string.o (.text) */
109 -/* lib_generic/vsprintf.o (.text) */
110 - lib_generic/crc32.o (.text)
111 - lib_generic/zlib.o (.text)
112 -/* board/bf537-stamp/bf537-stamp.o (.text) */
113 -
114 - . = DEFINED(env_offset) ? env_offset : .;
115 - common/environment.o (.text)
116 -
117 - *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .text)
118 - *(.fixup)
119 - *(.got1)
120 - } > ram
121 - _etext = .;
122 - PROVIDE (etext = .);
123 - .text_l1 :
124 - {
125 - . = ALIGN(4) ;
126 - _text_l1 = .;
127 - PROVIDE (text_l1 = .);
128 - board/bf537-stamp/post-memory.o (.text)
129 - . = ALIGN(4) ;
130 - _etext_l1 = .;
131 - PROVIDE (etext_l1 = .);
132 - } > l1_code AT > ram
133 -
134 - .rodata :
135 - {
136 - . = ALIGN(4);
137 - *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .rodata)
138 - *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .rodata1)
139 - *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .rodata.str1.4)
140 - *(.eh_frame)
141 - . = ALIGN(4);
142 - } > ram
143 -
144 - . = ALIGN(4);
145 - _erodata = .;
146 - PROVIDE (erodata = .);
147 - .rodata_l1 :
148 - {
149 - . = ALIGN(4) ;
150 - _rodata_l1 = .;
151 - PROVIDE (rodata_l1 = .);
152 - board/bf537-stamp/post-memory.o (.rodata)
153 - board/bf537-stamp/post-memory.o (.rodata1)
154 - board/bf537-stamp/post-memory.o (.rodata.str1.4)
155 - . = ALIGN(4) ;
156 - _erodata_l1 = .;
157 - PROVIDE(erodata_l1 = .);
158 - } > l1_data AT > ram
159 -
160 - .fini : { *(.fini) } =0
161 - .ctors : { *(.ctors) }
162 - .dtors : { *(.dtors) }
163 -
164 - /* Read-write section, merged into data segment: */
165 - . = (. + 0x00FF) & 0xFFFFFF00;
166 - _erotext = .;
167 - PROVIDE (erotext = .);
168 - .reloc :
169 - {
170 - *(.got)
171 - _GOT2_TABLE_ = .;
172 - *(.got2)
173 - _FIXUP_TABLE_ = .;
174 - *(.fixup)
175 - }
176 - __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
177 - __fixup_entries = (. - _FIXUP_TABLE_)>>2;
178 -
179 - .data :
180 - {
181 - *(.data)
182 - *(.data1)
183 - *(.sdata)
184 - *(.sdata2)
185 - *(.dynamic)
186 - CONSTRUCTORS
187 - } > ram
188 - _edata = .;
189 - PROVIDE (edata = .);
190 -
191 - ___u_boot_cmd_start = .;
192 - .u_boot_cmd : { *(.u_boot_cmd) } > ram
193 - ___u_boot_cmd_end = .;
194 -
195 -
196 - __start___ex_table = .;
197 - __ex_table : { *(__ex_table) }
198 - __stop___ex_table = .;
199 -
200 - . = ALIGN(256);
201 - __init_begin = .;
202 - .text.init : { *(.text.init) }
203 - .data.init : { *(.data.init) }
204 - . = ALIGN(256);
205 - __init_end = .;
206 -
207 - .bss :
208 - {
209 - __bss_start = .;
210 - *(.sbss) *(.scommon)
211 - *(.dynbss)
212 - *(.bss)
213 - *(COMMON)
214 - } > ram
215 - _end = . ;
216 - PROVIDE (end = .);
217 -}
218 -
219 Index: board/bf537-stamp/u-boot.lds.S
220 ===================================================================
221 --- board/bf537-stamp/u-boot.lds.S (revision 608)
222 +++ board/bf537-stamp/u-boot.lds.S (working copy)
223 @@ -25,6 +25,8 @@
224 * MA 02111-1307 USA
225 */
226
227 +#include <config.h>
228 +
229 OUTPUT_ARCH(bfin)
230 SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
231 /* Do we need any of these for elf?
232 @@ -62,6 +64,7 @@
233 .rela.plt : { *(.rela.plt) }
234 .init : { *(.init) }
235 .plt : { *(.plt) }
236 + . = CFG_MONITOR_BASE;
237 .text :
238 {
239 /* WARNING - the following is hand-optimized to fit within */
240 Index: board/bf537-stamp/config.mk
241 ===================================================================
242 --- board/bf537-stamp/config.mk (revision 608)
243 +++ board/bf537-stamp/config.mk (working copy)
244 @@ -21,4 +21,4 @@
245 # MA 02111-1307 USA
246 #
247
248 -TEXT_BASE = 0x03FC0000
249 +TEXT_BASE = do-not-use-me
250 Index: board/bf537-stamp/Makefile
251 ===================================================================
252 --- board/bf537-stamp/Makefile (revision 608)
253 +++ board/bf537-stamp/Makefile (working copy)
254 @@ -31,9 +31,13 @@
255
256 OBJS = $(BOARD).o flash.o ether_bf537.o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o
257
258 -$(LIB): .depend $(OBJS)
259 +$(LIB): .depend $(OBJS) u-boot.lds
260 $(AR) cr $@ $(OBJS)
261
262 +u-boot.lds: u-boot.lds.S
263 + $(CPP) $(CPPFLAGS) -P -Ubfin $^ > $@.tmp
264 + mv -f $@.tmp $@
265 +
266 #########################################################################
267
268 .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)