1/* SPDX-License-Identifier: GPL-2.0 */
2
3#define RO_EXCEPTION_TABLE_ALIGN	16
4
5#include <asm-generic/vmlinux.lds.h>
6#include <asm/page.h>
7#include <asm/thread_info.h>
8
9#define ROMTOP 0x000000
10#define RAMTOP 0x400000
11
12jiffies = jiffies_64 + 4;
13
14ENTRY(_start)
15
16SECTIONS
17{
18#if defined(CONFIG_ROMKERNEL)
19	. = ROMTOP;
20	.vectors :
21	{
22	_vector = . ;
23		*(.vector*)
24	}
25#else
26	. = RAMTOP;
27	_ramstart = .;
28	. = . + CONFIG_OFFSET;
29#endif
30	_text = .;
31	HEAD_TEXT_SECTION
32	.text : {
33	_stext = . ;
34		TEXT_TEXT
35		SCHED_TEXT
36		CPUIDLE_TEXT
37		LOCK_TEXT
38#if defined(CONFIG_ROMKERNEL)
39		*(.int_redirect)
40#endif
41	_etext = . ;
42	}
43	RO_DATA(4)
44	ROMEND = .;
45#if defined(CONFIG_ROMKERNEL)
46	. = RAMTOP;
47	_ramstart = .;
48#define ADDR(x) ROMEND
49#endif
50	_sdata = . ;
51	__data_start = . ;
52	RW_DATA(0, PAGE_SIZE, THREAD_SIZE)
53#if defined(CONFIG_ROMKERNEL)
54#undef ADDR
55#endif
56	. = ALIGN(0x4) ;
57	__init_begin = .;
58	INIT_TEXT_SECTION(4)
59	INIT_DATA_SECTION(4)
60	__init_end = .;
61	_edata = . ;
62	_begin_data = LOADADDR(.data);
63	_sbss =.;
64	BSS_SECTION(0, 0 ,0)
65	_ebss =.;
66	_ramend = .;
67	_end = .;
68	DISCARDS
69}
70