1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * 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>
7 */
8
9#include "config.h"
10
11#ifdef CONFIG_SYS_BIG_ENDIAN
12OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-sh-linux")
13#else
14OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
15#endif
16
17OUTPUT_ARCH(sh)
18
19MEMORY
20{
21	ram	: ORIGIN = CFG_SYS_SDRAM_BASE, LENGTH = CFG_SYS_SDRAM_SIZE
22}
23
24ENTRY(_start)
25
26SECTIONS
27{
28	. = CONFIG_TEXT_BASE;
29	reloc_dst = .;
30
31	PROVIDE (_ftext = .);
32	PROVIDE (_fcode = .);
33	PROVIDE (_start = .);
34
35	.text :
36	{
37		KEEP(*/start.o		(.text))
38		KEEP(CFG_BOARDDIR/lowlevel_init.o	(.text .spiboot1.text))
39		KEEP(*(.spiboot2.text))
40		. = ALIGN(8192);
41#ifdef CONFIG_ENV_IS_IN_FLASH
42		env/embedded.o  (.doesnotexist)
43		. = ALIGN(8192);
44#endif
45		*(.text)
46		. = ALIGN(4);
47	} >ram =0xFF
48	PROVIDE (_ecode = .);
49	.rodata :
50	{
51		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
52		. = ALIGN(4);
53	} >ram
54	PROVIDE (_etext = .);
55
56
57	PROVIDE (_fdata = .);
58	.data :
59	{
60		*(.data)
61		. = ALIGN(4);
62	} >ram
63	PROVIDE (_edata = .);
64
65	PROVIDE (_fgot = .);
66	.got :
67	{
68		*(.got.plt) *(.got)
69		. = ALIGN(4);
70	} >ram
71	PROVIDE (_egot = .);
72
73	__u_boot_list : {
74		KEEP(*(SORT(__u_boot_list*)));
75	} >ram
76
77	PROVIDE (__init_end = .);
78	PROVIDE (reloc_dst_end = .);
79	PROVIDE (_end = .);
80
81	PROVIDE (bss_start = .);
82	PROVIDE (__bss_start = .);
83	.bss :
84	{
85		*(.bss)
86		. = ALIGN(4);
87	} >ram
88	PROVIDE (bss_end = .);
89	PROVIDE (__bss_end = .);
90}
91