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