blob: 4cc97737f1c97e0ad6811f633460cbf20bfb80a1 [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{
Marek Vasutd1886a52019-09-14 19:03:32 +020028 . = CONFIG_SYS_TEXT_BASE;
Vladimir Zapolskiy621f5702016-11-28 00:15:27 +020029 reloc_dst = .;
Mark Jonas35a398a2008-03-10 11:37:10 +010030
31 PROVIDE (_ftext = .);
32 PROVIDE (_fcode = .);
33 PROVIDE (_start = .);
34
35 .text :
36 {
Masahiro Yamadaa9b82be2014-06-20 16:40:14 +090037 KEEP(*/start.o (.text))
Vladimir Zapolskiy28d1b0e2016-11-28 00:15:26 +020038 KEEP(CONFIG_BOARDDIR/lowlevel_init.o (.text .spiboot1.text))
Vladimir Zapolskiyfd717702016-11-28 00:15:25 +020039 KEEP(*(.spiboot2.text))
Mark Jonas35a398a2008-03-10 11:37:10 +010040 . = ALIGN(8192);
Tom Rini6989c7d2017-08-27 11:50:16 -040041#ifdef CONFIG_ENV_IS_IN_FLASH
42 env/embedded.o (.doesnotexist)
43 . = ALIGN(8192);
44#endif
Mark Jonas35a398a2008-03-10 11:37:10 +010045 *(.text)
46 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020047 } >ram =0xFF
Mark Jonas35a398a2008-03-10 11:37:10 +010048 PROVIDE (_ecode = .);
49 .rodata :
50 {
Trent Piepho4438e5e2009-02-18 15:22:05 -080051 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
Mark Jonas35a398a2008-03-10 11:37:10 +010052 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020053 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010054 PROVIDE (_etext = .);
55
56
57 PROVIDE (_fdata = .);
58 .data :
59 {
60 *(.data)
61 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020062 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010063 PROVIDE (_edata = .);
64
65 PROVIDE (_fgot = .);
66 .got :
67 {
Vladimir Zapolskiy188d54f2016-11-28 00:15:35 +020068 *(.got.plt) *(.got)
Mark Jonas35a398a2008-03-10 11:37:10 +010069 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020070 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010071 PROVIDE (_egot = .);
72
Marek Vasut607092a2012-10-12 10:27:03 +000073 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000074 KEEP(*(SORT(.u_boot_list*)));
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020075 } >ram
Marek Vasut607092a2012-10-12 10:27:03 +000076
Simon Glass6c2afb82016-05-14 18:49:29 -060077 PROVIDE (__init_end = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010078 PROVIDE (reloc_dst_end = .);
Marek Vasut5d0cd632019-09-01 18:05:03 +020079 PROVIDE (_end = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010080
81 PROVIDE (bss_start = .);
82 PROVIDE (__bss_start = .);
83 .bss :
84 {
85 *(.bss)
86 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020087 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010088 PROVIDE (bss_end = .);
Simon Glassed70c8f2013-03-14 06:54:53 +000089 PROVIDE (__bss_end = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010090}