blob: 7b225a6bd9a08f95da0dc1214aea27f78e74a1b6 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Mark Jonas3313e0e2008-03-10 11:37:10 +01002/*
Vladimir Zapolskiy8371dab2016-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 Jonas3313e0e2008-03-10 11:37:10 +01007 */
8
Vladimir Zapolskiy3f8b5392016-11-28 00:15:25 +02009#include "config.h"
10
Thomas Petazzoni90340c82017-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 Jonas3313e0e2008-03-10 11:37:10 +010014OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
Thomas Petazzoni90340c82017-07-28 23:14:28 +020015#endif
16
Mark Jonas3313e0e2008-03-10 11:37:10 +010017OUTPUT_ARCH(sh)
Vladimir Zapolskiy8371dab2016-11-28 00:15:28 +020018
19MEMORY
20{
21 ram : ORIGIN = CONFIG_SYS_SDRAM_BASE, LENGTH = CONFIG_SYS_SDRAM_SIZE
22}
23
Mark Jonas3313e0e2008-03-10 11:37:10 +010024ENTRY(_start)
25
26SECTIONS
27{
Vladimir Zapolskiyb26d2502016-11-28 00:15:27 +020028 reloc_dst = .;
Mark Jonas3313e0e2008-03-10 11:37:10 +010029
30 PROVIDE (_ftext = .);
31 PROVIDE (_fcode = .);
32 PROVIDE (_start = .);
33
34 .text :
35 {
Masahiro Yamadaafc39292014-06-20 16:40:14 +090036 KEEP(*/start.o (.text))
Vladimir Zapolskiy9ec4a672016-11-28 00:15:26 +020037 KEEP(CONFIG_BOARDDIR/lowlevel_init.o (.text .spiboot1.text))
Vladimir Zapolskiy3f8b5392016-11-28 00:15:25 +020038 KEEP(*(.spiboot2.text))
Mark Jonas3313e0e2008-03-10 11:37:10 +010039 . = ALIGN(8192);
Tom Rini34f98a32017-08-27 11:50:16 -040040#ifdef CONFIG_ENV_IS_IN_FLASH
41 env/embedded.o (.doesnotexist)
42 . = ALIGN(8192);
43#endif
Mark Jonas3313e0e2008-03-10 11:37:10 +010044 *(.text)
45 . = ALIGN(4);
Vladimir Zapolskiy8371dab2016-11-28 00:15:28 +020046 } >ram =0xFF
Mark Jonas3313e0e2008-03-10 11:37:10 +010047 PROVIDE (_ecode = .);
48 .rodata :
49 {
Trent Piephof62fb992009-02-18 15:22:05 -080050 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
Mark Jonas3313e0e2008-03-10 11:37:10 +010051 . = ALIGN(4);
Vladimir Zapolskiy8371dab2016-11-28 00:15:28 +020052 } >ram
Mark Jonas3313e0e2008-03-10 11:37:10 +010053 PROVIDE (_etext = .);
54
55
56 PROVIDE (_fdata = .);
57 .data :
58 {
59 *(.data)
60 . = ALIGN(4);
Vladimir Zapolskiy8371dab2016-11-28 00:15:28 +020061 } >ram
Mark Jonas3313e0e2008-03-10 11:37:10 +010062 PROVIDE (_edata = .);
63
64 PROVIDE (_fgot = .);
65 .got :
66 {
Vladimir Zapolskiy76a55982016-11-28 00:15:35 +020067 *(.got.plt) *(.got)
Mark Jonas3313e0e2008-03-10 11:37:10 +010068 . = ALIGN(4);
Vladimir Zapolskiy8371dab2016-11-28 00:15:28 +020069 } >ram
Mark Jonas3313e0e2008-03-10 11:37:10 +010070 PROVIDE (_egot = .);
71
Marek Vasut55675142012-10-12 10:27:03 +000072 .u_boot_list : {
Albert ARIBAUDef123c52013-02-25 00:59:00 +000073 KEEP(*(SORT(.u_boot_list*)));
Vladimir Zapolskiy8371dab2016-11-28 00:15:28 +020074 } >ram
Marek Vasut55675142012-10-12 10:27:03 +000075
Simon Glassf41e6082016-05-14 18:49:29 -060076 PROVIDE (__init_end = .);
Mark Jonas3313e0e2008-03-10 11:37:10 +010077 PROVIDE (reloc_dst_end = .);
Mark Jonas3313e0e2008-03-10 11:37:10 +010078
79 PROVIDE (bss_start = .);
80 PROVIDE (__bss_start = .);
81 .bss :
82 {
83 *(.bss)
84 . = ALIGN(4);
Vladimir Zapolskiy8371dab2016-11-28 00:15:28 +020085 } >ram
Mark Jonas3313e0e2008-03-10 11:37:10 +010086 PROVIDE (bss_end = .);
Simon Glass3929fb02013-03-14 06:54:53 +000087 PROVIDE (__bss_end = .);
Mark Jonas3313e0e2008-03-10 11:37:10 +010088}