blob: db5b14c5540e566245570ef692db536078fecfce [file] [log] [blame]
Mark Jonas35a398a2008-03-10 11:37:10 +01001/*
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +02002 * Copyright (C) 2016 Vladimir Zapolskiy <vz@mleia.com>
3 * Copyright (C) 2008-2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
4 * Copyright (C) 2008 Mark Jonas <mark.jonas@de.bosch.com>
5 * Copyright (C) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Wolfgang Denk35f734f2008-04-13 09:59:26 -07006 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Mark Jonas35a398a2008-03-10 11:37:10 +01008 */
9
Vladimir Zapolskiyfd717702016-11-28 00:15:25 +020010#include "config.h"
11
Thomas Petazzonica112322017-07-28 23:14:28 +020012#ifdef CONFIG_SYS_BIG_ENDIAN
13OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-sh-linux")
14#else
Mark Jonas35a398a2008-03-10 11:37:10 +010015OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
Thomas Petazzonica112322017-07-28 23:14:28 +020016#endif
17
Mark Jonas35a398a2008-03-10 11:37:10 +010018OUTPUT_ARCH(sh)
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020019
20MEMORY
21{
22 ram : ORIGIN = CONFIG_SYS_SDRAM_BASE, LENGTH = CONFIG_SYS_SDRAM_SIZE
23}
24
Mark Jonas35a398a2008-03-10 11:37:10 +010025ENTRY(_start)
26
27SECTIONS
28{
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 = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010079
80 PROVIDE (bss_start = .);
81 PROVIDE (__bss_start = .);
82 .bss :
83 {
84 *(.bss)
85 . = ALIGN(4);
Vladimir Zapolskiy71635bd2016-11-28 00:15:28 +020086 } >ram
Mark Jonas35a398a2008-03-10 11:37:10 +010087 PROVIDE (bss_end = .);
Simon Glassed70c8f2013-03-14 06:54:53 +000088 PROVIDE (__bss_end = .);
Mark Jonas35a398a2008-03-10 11:37:10 +010089}