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