Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4 LT |
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> | |
161bd3bf HD |
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). | |
1da177e4 | 16 | */ |
161bd3bf HD |
17 | #define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \ |
18 | *(.data..vm0.pgd) \ | |
19 | *(.data..vm0.pte) | |
20 | ||
6ca63662 | 21 | #define CC_USING_PATCHABLE_FUNCTION_ENTRY |
6e85e23e | 22 | #define RO_EXCEPTION_TABLE_ALIGN 8 |
6ca63662 | 23 | |
1da177e4 | 24 | #include <asm-generic/vmlinux.lds.h> |
161bd3bf | 25 | |
1da177e4 LT |
26 | /* needed for the processor specific cache alignment size */ |
27 | #include <asm/cache.h> | |
28 | #include <asm/page.h> | |
2fd83038 | 29 | #include <asm/asm-offsets.h> |
8cf06fc9 | 30 | #include <asm/thread_info.h> |
1da177e4 LT |
31 | |
32 | /* ld script to make hppa Linux kernel */ | |
33 | #ifndef CONFIG_64BIT | |
34 | OUTPUT_FORMAT("elf32-hppa-linux") | |
35 | OUTPUT_ARCH(hppa) | |
36 | #else | |
37 | OUTPUT_FORMAT("elf64-hppa-linux") | |
38 | OUTPUT_ARCH(hppa:hppa2.0w) | |
39 | #endif | |
40 | ||
200036a8 HD |
41 | #define EXIT_TEXT_SECTIONS() .exit.text : { EXIT_TEXT } |
42 | #if !defined(CONFIG_64BIT) || defined(CONFIG_MLONGCALLS) | |
43 | #define MLONGCALL_KEEP(x) | |
44 | #define MLONGCALL_DISCARD(x) x | |
45 | #else | |
46 | #define MLONGCALL_KEEP(x) x | |
47 | #define MLONGCALL_DISCARD(x) | |
48 | #endif | |
49 | ||
161bd3bf | 50 | ENTRY(parisc_kernel_start) |
1da177e4 LT |
51 | #ifndef CONFIG_64BIT |
52 | jiffies = jiffies_64 + 4; | |
53 | #else | |
54 | jiffies = jiffies_64; | |
55 | #endif | |
56 | SECTIONS | |
57 | { | |
be1b3d8c | 58 | . = KERNEL_BINARY_TEXT_START; |
1da177e4 | 59 | |
161bd3bf HD |
60 | __init_begin = .; |
61 | HEAD_TEXT_SECTION | |
200036a8 | 62 | MLONGCALL_DISCARD(INIT_TEXT_SECTION(8)) |
161bd3bf HD |
63 | |
64 | . = ALIGN(PAGE_SIZE); | |
65 | INIT_DATA_SECTION(PAGE_SIZE) | |
200036a8 | 66 | MLONGCALL_DISCARD(EXIT_TEXT_SECTIONS()) |
161bd3bf HD |
67 | .exit.data : |
68 | { | |
69 | EXIT_DATA | |
70 | } | |
71 | PERCPU_SECTION(8) | |
3847dab7 HD |
72 | . = ALIGN(4); |
73 | .altinstructions : { | |
74 | __alt_instructions = .; | |
75 | *(.altinstructions) | |
76 | __alt_instructions_end = .; | |
77 | } | |
41b85a11 | 78 | . = ALIGN(HUGEPAGE_SIZE); |
161bd3bf HD |
79 | __init_end = .; |
80 | /* freed after init ends here */ | |
81 | ||
be1b3d8c | 82 | _text = .; /* Text and read-only data */ |
98400ad7 | 83 | _stext = .; |
200036a8 | 84 | MLONGCALL_KEEP(INIT_TEXT_SECTION(8)) |
161bd3bf | 85 | .text ALIGN(PAGE_SIZE) : { |
be1b3d8c | 86 | TEXT_TEXT |
200036a8 | 87 | LOCK_TEXT |
be1b3d8c | 88 | SCHED_TEXT |
d75f054a HD |
89 | KPROBES_TEXT |
90 | IRQENTRY_TEXT | |
be7635e7 | 91 | SOFTIRQENTRY_TEXT |
be1b3d8c SR |
92 | *(.text.do_softirq) |
93 | *(.text.sys_exit) | |
94 | *(.text.do_sigaltstack) | |
95 | *(.text.do_fork) | |
6cd819e8 HD |
96 | *(.text.div) |
97 | *($$*) /* millicode routines */ | |
be1b3d8c SR |
98 | *(.text.*) |
99 | *(.fixup) | |
100 | *(.lock.text) /* out-of-line lock text */ | |
101 | *(.gnu.warning) | |
ed5fb247 | 102 | } |
200036a8 | 103 | MLONGCALL_KEEP(EXIT_TEXT_SECTIONS()) |
161bd3bf | 104 | . = ALIGN(PAGE_SIZE); |
be1b3d8c | 105 | _etext = .; |
161bd3bf | 106 | /* End of text section */ |
1da177e4 | 107 | |
a2d063ac SR |
108 | /* Start of data section */ |
109 | _sdata = .; | |
110 | ||
f8850abb | 111 | /* Architecturally we need to keep __gp below 0x1000000 and thus |
93240b32 | 112 | * in front of RO_DATA() which stores lots of tracepoint |
f8850abb | 113 | * and ftrace symbols. */ |
161bd3bf HD |
114 | #ifdef CONFIG_64BIT |
115 | . = ALIGN(16); | |
116 | /* Linkage tables */ | |
117 | .opd : { | |
1705bd6a | 118 | __start_opd = .; |
161bd3bf | 119 | *(.opd) |
1705bd6a | 120 | __end_opd = .; |
161bd3bf HD |
121 | } PROVIDE (__gp = .); |
122 | .plt : { | |
123 | *(.plt) | |
124 | } | |
125 | .dlt : { | |
126 | *(.dlt) | |
127 | } | |
128 | #endif | |
81b4b98a | 129 | |
2751153b | 130 | RO_DATA(PAGE_SIZE) |
f8850abb | 131 | |
be1b3d8c | 132 | /* unwind info */ |
c9fcb2b6 | 133 | . = ALIGN(4); |
be1b3d8c SR |
134 | .PARISC.unwind : { |
135 | __start___unwind = .; | |
136 | *(.PARISC.unwind) | |
137 | __stop___unwind = .; | |
138 | } | |
2fd83038 | 139 | |
161bd3bf HD |
140 | /* writeable */ |
141 | /* Make sure this is page aligned so | |
142 | * that we can properly leave these | |
143 | * as writable | |
144 | */ | |
41b85a11 | 145 | . = ALIGN(HUGEPAGE_SIZE); |
161bd3bf HD |
146 | data_start = .; |
147 | ||
be1b3d8c | 148 | /* Data */ |
c9174047 | 149 | RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE) |
1da177e4 | 150 | |
be1b3d8c SR |
151 | /* PA-RISC locks requires 16-byte alignment */ |
152 | . = ALIGN(16); | |
a7df554e DV |
153 | .data..lock_aligned : { |
154 | *(.data..lock_aligned) | |
be1b3d8c | 155 | } |
1da177e4 | 156 | |
be1b3d8c | 157 | /* End of data section */ |
4695e45e | 158 | . = ALIGN(PAGE_SIZE); |
be1b3d8c | 159 | _edata = .; |
1da177e4 | 160 | |
be1b3d8c | 161 | /* BSS */ |
41b85a11 HD |
162 | BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE) |
163 | ||
41b85a11 | 164 | . = ALIGN(HUGEPAGE_SIZE); |
be1b3d8c | 165 | _end = . ; |
5fb7dc37 | 166 | |
023bf6f1 | 167 | STABS_DEBUG |
c604abc3 | 168 | ELF_DETAILS |
023bf6f1 TH |
169 | .note 0 : { *(.note) } |
170 | ||
be1b3d8c | 171 | /* Sections to be discarded */ |
023bf6f1 | 172 | DISCARDS |
be1b3d8c | 173 | /DISCARD/ : { |
1da177e4 | 174 | #ifdef CONFIG_64BIT |
be1b3d8c SR |
175 | /* temporary hack until binutils is fixed to not emit these |
176 | * for static binaries | |
177 | */ | |
178 | *(.interp) | |
179 | *(.dynsym) | |
180 | *(.dynstr) | |
181 | *(.dynamic) | |
182 | *(.hash) | |
183 | *(.gnu.hash) | |
1da177e4 LT |
184 | #endif |
185 | } | |
1da177e4 | 186 | } |