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 | ||
1da177e4 | 21 | #include <asm-generic/vmlinux.lds.h> |
161bd3bf | 22 | |
1da177e4 LT |
23 | /* needed for the processor specific cache alignment size */ |
24 | #include <asm/cache.h> | |
25 | #include <asm/page.h> | |
2fd83038 | 26 | #include <asm/asm-offsets.h> |
8cf06fc9 | 27 | #include <asm/thread_info.h> |
1da177e4 LT |
28 | |
29 | /* ld script to make hppa Linux kernel */ | |
30 | #ifndef CONFIG_64BIT | |
31 | OUTPUT_FORMAT("elf32-hppa-linux") | |
32 | OUTPUT_ARCH(hppa) | |
33 | #else | |
34 | OUTPUT_FORMAT("elf64-hppa-linux") | |
35 | OUTPUT_ARCH(hppa:hppa2.0w) | |
36 | #endif | |
37 | ||
161bd3bf | 38 | ENTRY(parisc_kernel_start) |
1da177e4 LT |
39 | #ifndef CONFIG_64BIT |
40 | jiffies = jiffies_64 + 4; | |
41 | #else | |
42 | jiffies = jiffies_64; | |
43 | #endif | |
44 | SECTIONS | |
45 | { | |
be1b3d8c | 46 | . = KERNEL_BINARY_TEXT_START; |
1da177e4 | 47 | |
161bd3bf HD |
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) | |
3847dab7 HD |
64 | . = ALIGN(4); |
65 | .altinstructions : { | |
66 | __alt_instructions = .; | |
67 | *(.altinstructions) | |
68 | __alt_instructions_end = .; | |
69 | } | |
41b85a11 | 70 | . = ALIGN(HUGEPAGE_SIZE); |
161bd3bf HD |
71 | __init_end = .; |
72 | /* freed after init ends here */ | |
73 | ||
be1b3d8c | 74 | _text = .; /* Text and read-only data */ |
161bd3bf HD |
75 | _stext = .; |
76 | .text ALIGN(PAGE_SIZE) : { | |
be1b3d8c SR |
77 | TEXT_TEXT |
78 | SCHED_TEXT | |
6727ad9e | 79 | CPUIDLE_TEXT |
be1b3d8c | 80 | LOCK_TEXT |
d75f054a HD |
81 | KPROBES_TEXT |
82 | IRQENTRY_TEXT | |
be7635e7 | 83 | SOFTIRQENTRY_TEXT |
be1b3d8c SR |
84 | *(.text.do_softirq) |
85 | *(.text.sys_exit) | |
86 | *(.text.do_sigaltstack) | |
87 | *(.text.do_fork) | |
6cd819e8 HD |
88 | *(.text.div) |
89 | *($$*) /* millicode routines */ | |
be1b3d8c SR |
90 | *(.text.*) |
91 | *(.fixup) | |
92 | *(.lock.text) /* out-of-line lock text */ | |
93 | *(.gnu.warning) | |
ed5fb247 | 94 | } |
161bd3bf | 95 | . = ALIGN(PAGE_SIZE); |
be1b3d8c | 96 | _etext = .; |
161bd3bf | 97 | /* End of text section */ |
1da177e4 | 98 | |
a2d063ac SR |
99 | /* Start of data section */ |
100 | _sdata = .; | |
101 | ||
f8850abb HD |
102 | /* Architecturally we need to keep __gp below 0x1000000 and thus |
103 | * in front of RO_DATA_SECTION() which stores lots of tracepoint | |
104 | * and ftrace symbols. */ | |
161bd3bf HD |
105 | #ifdef CONFIG_64BIT |
106 | . = ALIGN(16); | |
107 | /* Linkage tables */ | |
108 | .opd : { | |
1705bd6a | 109 | __start_opd = .; |
161bd3bf | 110 | *(.opd) |
1705bd6a | 111 | __end_opd = .; |
161bd3bf HD |
112 | } PROVIDE (__gp = .); |
113 | .plt : { | |
114 | *(.plt) | |
115 | } | |
116 | .dlt : { | |
117 | *(.dlt) | |
118 | } | |
119 | #endif | |
81b4b98a | 120 | |
f8850abb HD |
121 | RO_DATA_SECTION(8) |
122 | ||
f79b076e HD |
123 | /* RO because of BUILDTIME_EXTABLE_SORT */ |
124 | EXCEPTION_TABLE(8) | |
125 | NOTES | |
126 | ||
be1b3d8c SR |
127 | /* unwind info */ |
128 | .PARISC.unwind : { | |
129 | __start___unwind = .; | |
130 | *(.PARISC.unwind) | |
131 | __stop___unwind = .; | |
132 | } | |
2fd83038 | 133 | |
161bd3bf HD |
134 | /* writeable */ |
135 | /* Make sure this is page aligned so | |
136 | * that we can properly leave these | |
137 | * as writable | |
138 | */ | |
41b85a11 | 139 | . = ALIGN(HUGEPAGE_SIZE); |
161bd3bf HD |
140 | data_start = .; |
141 | ||
be1b3d8c | 142 | /* Data */ |
9372450c | 143 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE) |
1da177e4 | 144 | |
be1b3d8c SR |
145 | /* PA-RISC locks requires 16-byte alignment */ |
146 | . = ALIGN(16); | |
a7df554e DV |
147 | .data..lock_aligned : { |
148 | *(.data..lock_aligned) | |
be1b3d8c | 149 | } |
1da177e4 | 150 | |
be1b3d8c SR |
151 | /* End of data section */ |
152 | _edata = .; | |
1da177e4 | 153 | |
be1b3d8c | 154 | /* BSS */ |
41b85a11 HD |
155 | BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE) |
156 | ||
41b85a11 | 157 | . = ALIGN(HUGEPAGE_SIZE); |
be1b3d8c | 158 | _end = . ; |
5fb7dc37 | 159 | |
023bf6f1 TH |
160 | STABS_DEBUG |
161 | .note 0 : { *(.note) } | |
162 | ||
be1b3d8c | 163 | /* Sections to be discarded */ |
023bf6f1 | 164 | DISCARDS |
be1b3d8c | 165 | /DISCARD/ : { |
1da177e4 | 166 | #ifdef CONFIG_64BIT |
be1b3d8c SR |
167 | /* temporary hack until binutils is fixed to not emit these |
168 | * for static binaries | |
169 | */ | |
170 | *(.interp) | |
171 | *(.dynsym) | |
172 | *(.dynstr) | |
173 | *(.dynamic) | |
174 | *(.hash) | |
175 | *(.gnu.hash) | |
1da177e4 LT |
176 | #endif |
177 | } | |
1da177e4 | 178 | } |