xref: /openbmc/u-boot/arch/sh/cpu/u-boot.lds (revision ae485b54)
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 = CONFIG_SYS_SDRAM_BASE, LENGTH = CONFIG_SYS_SDRAM_SIZE
22}
23
24ENTRY(_start)
25
26SECTIONS
27{
28	reloc_dst = .;
29
30	PROVIDE (_ftext = .);
31	PROVIDE (_fcode = .);
32	PROVIDE (_start = .);
33
34	.text :
35	{
36		KEEP(*/start.o		(.text))
37		KEEP(CONFIG_BOARDDIR/lowlevel_init.o	(.text .spiboot1.text))
38		KEEP(*(.spiboot2.text))
39		. = ALIGN(8192);
40#ifdef CONFIG_ENV_IS_IN_FLASH
41		env/embedded.o  (.doesnotexist)
42		. = ALIGN(8192);
43#endif
44		*(.text)
45		. = ALIGN(4);
46	} >ram =0xFF
47	PROVIDE (_ecode = .);
48	.rodata :
49	{
50		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
51		. = ALIGN(4);
52	} >ram
53	PROVIDE (_etext = .);
54
55
56	PROVIDE (_fdata = .);
57	.data :
58	{
59		*(.data)
60		. = ALIGN(4);
61	} >ram
62	PROVIDE (_edata = .);
63
64	PROVIDE (_fgot = .);
65	.got :
66	{
67		*(.got.plt) *(.got)
68		. = ALIGN(4);
69	} >ram
70	PROVIDE (_egot = .);
71
72	.u_boot_list : {
73		KEEP(*(SORT(.u_boot_list*)));
74	} >ram
75
76	PROVIDE (__init_end = .);
77	PROVIDE (reloc_dst_end = .);
78
79	PROVIDE (bss_start = .);
80	PROVIDE (__bss_start = .);
81	.bss :
82	{
83		*(.bss)
84		. = ALIGN(4);
85	} >ram
86	PROVIDE (bss_end = .);
87	PROVIDE (__bss_end = .);
88}
89