• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0 */
2/* ld script to make the Linux/CRIS kernel
3 * Authors: Bjorn Wesen (bjornw@axis.com)
4 *
5 * It is VERY DANGEROUS to fiddle around with the symbols in this
6 * script. It is for example quite vital that all generated sections
7 * that are used are actually named here, otherwise the linker will
8 * put them at the end, where the init stuff is which is FREED after
9 * the kernel has booted.
10 */
11
12#include <asm-generic/vmlinux.lds.h>
13#include <asm/page.h>
14
15#ifdef CONFIG_ETRAX_VMEM_SIZE
16#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
17#else
18#define __CONFIG_ETRAX_VMEM_SIZE 0
19#endif
20
21
22jiffies = jiffies_64;
23SECTIONS
24{
25	. = DRAM_VIRTUAL_BASE;
26	dram_start = .;
27#ifdef CONFIG_ETRAX_ARCH_V10
28	ibr_start = .;
29#else
30	ebp_start = .;
31	/* The boot section is only necessary until the VCS top */
32	/* level testbench includes both flash and DRAM. */
33	.boot : { *(.boot) }
34#endif
35
36	/* see head.S and pages reserved at the start */
37	. = DRAM_VIRTUAL_BASE + 0x4000;
38
39	_text = .;			/* Text and read-only data. */
40	text_start = .;			/* Lots of aliases. */
41	_stext = .;
42	__stext = .;
43	.text : {
44		HEAD_TEXT
45		TEXT_TEXT
46		SCHED_TEXT
47		CPUIDLE_TEXT
48		LOCK_TEXT
49		*(.fixup)
50		*(.text.__*)
51	}
52
53	_etext = . ;			/* End of text section. */
54	__etext = .;
55
56	EXCEPTION_TABLE(4)
57
58	_sdata = .;
59	RODATA
60
61	. = ALIGN (4);
62	___data_start = . ;
63	__Sdata = . ;
64	.data : {			/* Data */
65		CACHELINE_ALIGNED_DATA(32)
66		READ_MOSTLY_DATA(32)
67		DATA_DATA
68	}
69	__edata = . ;			/* End of data section. */
70	_edata = . ;
71
72	BUG_TABLE
73
74	INIT_TASK_DATA_SECTION(PAGE_SIZE)
75
76	. = ALIGN(PAGE_SIZE);		/* Init code and data. */
77	__init_begin = .;
78	INIT_TEXT_SECTION(PAGE_SIZE)
79	.init.data : { INIT_DATA }
80	.init.setup : { INIT_SETUP(16) }
81	.initcall.init : {
82		INIT_CALLS
83	}
84
85	.con_initcall.init : {
86		CON_INITCALL
87	}
88	SECURITY_INIT
89
90	/* .exit.text is discarded at runtime, not link time,
91	 * to deal with references from __bug_table
92	 */
93	.exit.text : {
94		EXIT_TEXT
95	}
96	.exit.data : {
97		EXIT_DATA
98	}
99
100#ifdef CONFIG_ETRAX_ARCH_V10
101#ifdef CONFIG_BLK_DEV_INITRD
102	.init.ramfs : {
103		__initramfs_start = .;
104		*(.init.ramfs)
105		__initramfs_end = .;
106	}
107#endif
108#endif
109	__vmlinux_end = .;		/* Last address of the physical file. */
110#ifdef CONFIG_ETRAX_ARCH_V32
111	PERCPU_SECTION(32)
112
113	.init.ramfs : {
114		INIT_RAM_FS
115	}
116#endif
117
118	/*
119	 * We fill to the next page, so we can discard all init
120	 * pages without needing to consider what payload might be
121	 * appended to the kernel image.
122	 */
123	. = ALIGN(PAGE_SIZE);
124
125	__init_end = .;
126
127	__data_end = . ;		/* Move to _edata ? */
128	BSS_SECTION(1, 1, 1)
129
130	. =  ALIGN (0x20);
131	_end = .;
132	__end = .;
133
134	dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
135
136	DISCARDS
137}
138