• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * ld script to make SuperH Linux kernel
4 * Written by Niibe Yutaka and Paul Mundt
5 */
6#ifdef CONFIG_SUPERH64
7#define LOAD_OFFSET	PAGE_OFFSET
8OUTPUT_ARCH(sh:sh5)
9#else
10#define LOAD_OFFSET	0
11OUTPUT_ARCH(sh)
12#endif
13#define RUNTIME_DISCARD_EXIT
14
15#include <asm/thread_info.h>
16#include <asm/cache.h>
17#include <asm/vmlinux.lds.h>
18
19#ifdef CONFIG_PMB
20 #define MEMORY_OFFSET	0
21#else
22 #define MEMORY_OFFSET	__MEMORY_START
23#endif
24
25ENTRY(_start)
26SECTIONS
27{
28	. = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
29
30	_text = .;		/* Text and read-only data */
31
32	.empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) {
33		*(.empty_zero_page)
34	} = 0
35
36	.text : AT(ADDR(.text) - LOAD_OFFSET) {
37		HEAD_TEXT
38		TEXT_TEXT
39		EXTRA_TEXT
40		SCHED_TEXT
41		CPUIDLE_TEXT
42		LOCK_TEXT
43		KPROBES_TEXT
44		IRQENTRY_TEXT
45		SOFTIRQENTRY_TEXT
46		*(.fixup)
47		*(.gnu.warning)
48		_etext = .;		/* End of text section */
49	} = 0x0009
50
51	EXCEPTION_TABLE(16)
52	NOTES
53
54	_sdata = .;
55	RO_DATA(PAGE_SIZE)
56	RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
57	_edata = .;
58
59	DWARF_EH_FRAME
60
61	. = ALIGN(PAGE_SIZE);		/* Init code and data */
62	__init_begin = .;
63	INIT_TEXT_SECTION(PAGE_SIZE)
64	INIT_DATA_SECTION(16)
65
66	. = ALIGN(4);
67	.machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) {
68		__machvec_start = .;
69		*(.machvec.init)
70		__machvec_end = .;
71	}
72
73	PERCPU_SECTION(L1_CACHE_BYTES)
74
75	/*
76	 * .exit.text is discarded at runtime, not link time, to deal with
77	 * references from __bug_table
78	 */
79	.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT }
80	.exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA }
81
82	. = ALIGN(PAGE_SIZE);
83	__init_end = .;
84	BSS_SECTION(0, PAGE_SIZE, 4)
85	_end = . ;
86
87	STABS_DEBUG
88	DWARF_DEBUG
89
90	DISCARDS
91}
92