Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 2 | /* |
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 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> | ||||
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 7 | */ |
8 | |||||
Vladimir Zapolskiy | 3f8b539 | 2016-11-28 00:15:25 +0200 | [diff] [blame] | 9 | #include "config.h" |
10 | |||||
Thomas Petazzoni | 90340c8 | 2017-07-28 23:14:28 +0200 | [diff] [blame] | 11 | #ifdef CONFIG_SYS_BIG_ENDIAN |
12 | OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-sh-linux") | ||||
13 | #else | ||||
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 14 | OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") |
Thomas Petazzoni | 90340c8 | 2017-07-28 23:14:28 +0200 | [diff] [blame] | 15 | #endif |
16 | |||||
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 17 | OUTPUT_ARCH(sh) |
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 18 | |
19 | MEMORY | ||||
20 | { | ||||
21 | ram : ORIGIN = CONFIG_SYS_SDRAM_BASE, LENGTH = CONFIG_SYS_SDRAM_SIZE | ||||
22 | } | ||||
23 | |||||
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 24 | ENTRY(_start) |
25 | |||||
26 | SECTIONS | ||||
27 | { | ||||
Marek Vasut | e914109 | 2019-09-14 19:03:32 +0200 | [diff] [blame] | 28 | . = CONFIG_SYS_TEXT_BASE; |
Vladimir Zapolskiy | b26d250 | 2016-11-28 00:15:27 +0200 | [diff] [blame] | 29 | reloc_dst = .; |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 30 | |
31 | PROVIDE (_ftext = .); | ||||
32 | PROVIDE (_fcode = .); | ||||
33 | PROVIDE (_start = .); | ||||
34 | |||||
35 | .text : | ||||
36 | { | ||||
Masahiro Yamada | afc3929 | 2014-06-20 16:40:14 +0900 | [diff] [blame] | 37 | KEEP(*/start.o (.text)) |
Vladimir Zapolskiy | 9ec4a67 | 2016-11-28 00:15:26 +0200 | [diff] [blame] | 38 | KEEP(CONFIG_BOARDDIR/lowlevel_init.o (.text .spiboot1.text)) |
Vladimir Zapolskiy | 3f8b539 | 2016-11-28 00:15:25 +0200 | [diff] [blame] | 39 | KEEP(*(.spiboot2.text)) |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 40 | . = ALIGN(8192); |
Tom Rini | 34f98a3 | 2017-08-27 11:50:16 -0400 | [diff] [blame] | 41 | #ifdef CONFIG_ENV_IS_IN_FLASH |
42 | env/embedded.o (.doesnotexist) | ||||
43 | . = ALIGN(8192); | ||||
44 | #endif | ||||
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 45 | *(.text) |
46 | . = ALIGN(4); | ||||
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 47 | } >ram =0xFF |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 48 | PROVIDE (_ecode = .); |
49 | .rodata : | ||||
50 | { | ||||
Trent Piepho | f62fb99 | 2009-02-18 15:22:05 -0800 | [diff] [blame] | 51 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 52 | . = ALIGN(4); |
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 53 | } >ram |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 54 | PROVIDE (_etext = .); |
55 | |||||
56 | |||||
57 | PROVIDE (_fdata = .); | ||||
58 | .data : | ||||
59 | { | ||||
60 | *(.data) | ||||
61 | . = ALIGN(4); | ||||
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 62 | } >ram |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 63 | PROVIDE (_edata = .); |
64 | |||||
65 | PROVIDE (_fgot = .); | ||||
66 | .got : | ||||
67 | { | ||||
Vladimir Zapolskiy | 76a5598 | 2016-11-28 00:15:35 +0200 | [diff] [blame] | 68 | *(.got.plt) *(.got) |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 69 | . = ALIGN(4); |
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 70 | } >ram |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 71 | PROVIDE (_egot = .); |
72 | |||||
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 73 | .u_boot_list : { |
Albert ARIBAUD | ef123c5 | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 74 | KEEP(*(SORT(.u_boot_list*))); |
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 75 | } >ram |
Marek Vasut | 5567514 | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 76 | |
Simon Glass | f41e608 | 2016-05-14 18:49:29 -0600 | [diff] [blame] | 77 | PROVIDE (__init_end = .); |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 78 | PROVIDE (reloc_dst_end = .); |
Marek Vasut | ee3a4a7 | 2019-09-01 18:05:03 +0200 | [diff] [blame] | 79 | PROVIDE (_end = .); |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 80 | |
81 | PROVIDE (bss_start = .); | ||||
82 | PROVIDE (__bss_start = .); | ||||
83 | .bss : | ||||
84 | { | ||||
85 | *(.bss) | ||||
86 | . = ALIGN(4); | ||||
Vladimir Zapolskiy | 8371dab | 2016-11-28 00:15:28 +0200 | [diff] [blame] | 87 | } >ram |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 88 | PROVIDE (bss_end = .); |
Simon Glass | 3929fb0 | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 89 | PROVIDE (__bss_end = .); |
Mark Jonas | 3313e0e | 2008-03-10 11:37:10 +0100 | [diff] [blame] | 90 | } |