xref: /openbmc/linux/arch/parisc/kernel/vmlinux.lds.S (revision 68198dca)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*    Kernel link layout for various "sections"
3 *
4 *    Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
5 *    Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
6 *    Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
7 *    Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
8 *    Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
9 *    Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
10 *    Copyright (C) 2006-2013 Helge Deller <deller@gmx.de>
11 */
12
13/*
14 * Put page table entries (swapper_pg_dir) as the first thing in .bss. This
15 * will ensure that it has .bss alignment (PAGE_SIZE).
16 */
17#define BSS_FIRST_SECTIONS	*(.data..vm0.pmd) \
18				*(.data..vm0.pgd) \
19				*(.data..vm0.pte)
20
21#include <asm-generic/vmlinux.lds.h>
22
23/* needed for the processor specific cache alignment size */
24#include <asm/cache.h>
25#include <asm/page.h>
26#include <asm/asm-offsets.h>
27#include <asm/thread_info.h>
28
29/* ld script to make hppa Linux kernel */
30#ifndef CONFIG_64BIT
31OUTPUT_FORMAT("elf32-hppa-linux")
32OUTPUT_ARCH(hppa)
33#else
34OUTPUT_FORMAT("elf64-hppa-linux")
35OUTPUT_ARCH(hppa:hppa2.0w)
36#endif
37
38ENTRY(parisc_kernel_start)
39#ifndef CONFIG_64BIT
40jiffies = jiffies_64 + 4;
41#else
42jiffies = jiffies_64;
43#endif
44SECTIONS
45{
46	. = KERNEL_BINARY_TEXT_START;
47
48	__init_begin = .;
49	HEAD_TEXT_SECTION
50	INIT_TEXT_SECTION(8)
51
52	. = ALIGN(PAGE_SIZE);
53	INIT_DATA_SECTION(PAGE_SIZE)
54	/* we have to discard exit text and such at runtime, not link time */
55	.exit.text :
56	{
57		EXIT_TEXT
58	}
59	.exit.data :
60	{
61		EXIT_DATA
62	}
63	PERCPU_SECTION(8)
64	. = ALIGN(HUGEPAGE_SIZE);
65	__init_end = .;
66	/* freed after init ends here */
67
68	_text = .;		/* Text and read-only data */
69	_stext = .;
70	.text ALIGN(PAGE_SIZE) : {
71		TEXT_TEXT
72		SCHED_TEXT
73		CPUIDLE_TEXT
74		LOCK_TEXT
75		KPROBES_TEXT
76		IRQENTRY_TEXT
77		SOFTIRQENTRY_TEXT
78		*(.text.do_softirq)
79		*(.text.sys_exit)
80		*(.text.do_sigaltstack)
81		*(.text.do_fork)
82		*(.text.div)
83		*($$*)			/* millicode routines */
84		*(.text.*)
85		*(.fixup)
86		*(.lock.text)		/* out-of-line lock text */
87		*(.gnu.warning)
88	}
89	. = ALIGN(PAGE_SIZE);
90	_etext = .;
91	/* End of text section */
92
93	/* Start of data section */
94	_sdata = .;
95
96	/* Architecturally we need to keep __gp below 0x1000000 and thus
97	 * in front of RO_DATA_SECTION() which stores lots of tracepoint
98	 * and ftrace symbols. */
99#ifdef CONFIG_64BIT
100	. = ALIGN(16);
101	/* Linkage tables */
102	.opd : {
103		*(.opd)
104	} PROVIDE (__gp = .);
105	.plt : {
106		*(.plt)
107	}
108	.dlt : {
109		*(.dlt)
110	}
111#endif
112
113	RO_DATA_SECTION(8)
114
115	/* RO because of BUILDTIME_EXTABLE_SORT */
116	EXCEPTION_TABLE(8)
117	NOTES
118
119	/* unwind info */
120	.PARISC.unwind : {
121		__start___unwind = .;
122		*(.PARISC.unwind)
123		__stop___unwind = .;
124	}
125
126	/* writeable */
127	/* Make sure this is page aligned so
128	 * that we can properly leave these
129	 * as writable
130	 */
131	. = ALIGN(HUGEPAGE_SIZE);
132	data_start = .;
133
134	/* Data */
135	RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
136
137	/* PA-RISC locks requires 16-byte alignment */
138	. = ALIGN(16);
139	.data..lock_aligned : {
140		*(.data..lock_aligned)
141	}
142
143	/* End of data section */
144	_edata = .;
145
146	/* BSS */
147	BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
148
149	. = ALIGN(HUGEPAGE_SIZE);
150	_end = . ;
151
152	STABS_DEBUG
153	.note 0 : { *(.note) }
154
155	/* Sections to be discarded */
156	DISCARDS
157	/DISCARD/ : {
158#ifdef CONFIG_64BIT
159		/* temporary hack until binutils is fixed to not emit these
160	 	 * for static binaries
161		 */
162		*(.interp)
163		*(.dynsym)
164		*(.dynstr)
165		*(.dynamic)
166		*(.hash)
167		*(.gnu.hash)
168#endif
169	}
170}
171