blob: 7b225a6bd9a08f95da0dc1214aea27f78e74a1b6 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Mark Jonas35a398a2008-03-10 11:37:10 +01002/*
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +02003 * Copyright (C) 2016 Vladimir Zapolskiy <vz@mleia.com>
4 * Copyright (C) 2008-2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
5 * Copyright (C) 2008 Mark Jonas <mark.jonas@de.bosch.com>
6 * Copyright (C) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Mark Jonas35a398a2008-03-10 11:37:10 +01007 */
8
Vladimir Zapolskiyfd717702016-11-28 00:15:25 +02009#include "config.h"
10
Thomas Petazzonica112322017-07-28 23:14:28 +020011#ifdef CONFIG_SYS_BIG_ENDIAN
12OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-sh-linux")
13#else
Mark Jonas35a398a2008-03-10 11:37:10 +010014OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
Thomas Petazzonica112322017-07-28 23:14:28 +020015#endif
16
Mark Jonas35a398a2008-03-10 11:37:10 +010017OUTPUT_ARCH(sh)
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020018
19MEMORY
20{
21 ram : ORIGIN = CONFIG_SYS_SDRAM_BASE, LENGTH = CONFIG_SYS_SDRAM_SIZE
22}
23
Mark Jonas35a398a2008-03-10 11:37:10 +010024ENTRY(_start)
25
26SECTIONS
27{
Vladimir Zapolskiy621f5702016-11-28 00:15:27 +020028 reloc_dst = .;
Mark Jonas35a398a2008-03-10 11:37:10 +010029
30 PROVIDE (_ftext = .);
31 PROVIDE (_fcode = .);
32 PROVIDE (_start = .);
33
34 .text :
35 {
Masahiro Yamadaa9b82be2014-06-20 16:40:14 +090036 KEEP(*/start.o (.text))
Vladimir Zapolskiy28d1b0e2016-11-28 00:15:26 +020037 KEEP(CONFIG_BOARDDIR/lowlevel_init.o (.text .spiboot1.text))
Vladimir Zapolskiyfd717702016-11-28 00:15:25 +020038 KEEP(*(.spiboot2.text))
Mark Jonas35a398a2008-03-10 11:37:10 +010039 . = ALIGN(8192);
Tom Rini6989c7d2017-08-27 11:50:16 -040040#ifdef CONFIG_ENV_IS_IN_FLASH
41 env/embedded.o (.doesnotexist)
42 . = ALIGN(8192);
43#endif
Mark Jonas35a398a2008-03-10 11:37:10 +010044 *(.text)
45 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020046 } >ram =0xFF
Mark Jonas35a398a2008-03-10 11:37:10 +010047 PROVIDE (_ecode = .);
48 .rodata :
49 {
Trent Piepho4438e5e2009-02-18 15:22:05 -080050 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
Mark Jonas35a398a2008-03-10 11:37:10 +010051 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020052 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010053 PROVIDE (_etext = .);
54
55
56 PROVIDE (_fdata = .);
57 .data :
58 {
59 *(.data)
60 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020061 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010062 PROVIDE (_edata = .);
63
64 PROVIDE (_fgot = .);
65 .got :
66 {
Vladimir Zapolskiy188d54f2016-11-28 00:15:35 +020067 *(.got.plt) *(.got)
Mark Jonas35a398a2008-03-10 11:37:10 +010068 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020069 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010070 PROVIDE (_egot = .);
71
Marek Vasut607092a2012-10-12 10:27:03 +000072 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000073 KEEP(*(SORT(.u_boot_list*)));
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020074 } >ram
Marek Vasut607092a2012-10-12 10:27:03 +000075
Simon Glass6c2afb82016-05-14 18:49:29 -060076 PROVIDE (__init_end = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010077 PROVIDE (reloc_dst_end = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010078
79 PROVIDE (bss_start = .);
80 PROVIDE (__bss_start = .);
81 .bss :
82 {
83 *(.bss)
84 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020085 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010086 PROVIDE (bss_end = .);
Simon Glassed70c8f2013-03-14 06:54:53 +000087 PROVIDE (__bss_end = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010088}