Loading...
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 RO_DATA_SECTION(8)
93
94#ifdef CONFIG_64BIT
95 . = ALIGN(16);
96 /* Linkage tables */
97 .opd : {
98 *(.opd)
99 } PROVIDE (__gp = .);
100 .plt : {
101 *(.plt)
102 }
103 .dlt : {
104 *(.dlt)
105 }
106#endif
107
108 /* unwind info */
109 .PARISC.unwind : {
110 __start___unwind = .;
111 *(.PARISC.unwind)
112 __stop___unwind = .;
113 }
114
115 /* writeable */
116 /* Make sure this is page aligned so
117 * that we can properly leave these
118 * as writable
119 */
120 . = ALIGN(HUGEPAGE_SIZE);
121 data_start = .;
122
123 EXCEPTION_TABLE(8)
124 NOTES
125
126 /* Data */
127 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
128
129 /* PA-RISC locks requires 16-byte alignment */
130 . = ALIGN(16);
131 .data..lock_aligned : {
132 *(.data..lock_aligned)
133 }
134
135 /* End of data section */
136 _edata = .;
137
138 /* BSS */
139 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
140
141 /* bootmap is allocated in setup_bootmem() directly behind bss. */
142
143 . = ALIGN(HUGEPAGE_SIZE);
144 _end = . ;
145
146 STABS_DEBUG
147 .note 0 : { *(.note) }
148
149 /* Sections to be discarded */
150 DISCARDS
151 /DISCARD/ : {
152#ifdef CONFIG_64BIT
153 /* temporary hack until binutils is fixed to not emit these
154 * for static binaries
155 */
156 *(.interp)
157 *(.dynsym)
158 *(.dynstr)
159 *(.dynamic)
160 *(.hash)
161 *(.gnu.hash)
162#endif
163 }
164}
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 __start_opd = .;
104 *(.opd)
105 __end_opd = .;
106 } PROVIDE (__gp = .);
107 .plt : {
108 *(.plt)
109 }
110 .dlt : {
111 *(.dlt)
112 }
113#endif
114
115 RO_DATA_SECTION(8)
116
117 /* RO because of BUILDTIME_EXTABLE_SORT */
118 EXCEPTION_TABLE(8)
119 NOTES
120
121 /* unwind info */
122 .PARISC.unwind : {
123 __start___unwind = .;
124 *(.PARISC.unwind)
125 __stop___unwind = .;
126 }
127
128 /* writeable */
129 /* Make sure this is page aligned so
130 * that we can properly leave these
131 * as writable
132 */
133 . = ALIGN(HUGEPAGE_SIZE);
134 data_start = .;
135
136 /* Data */
137 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
138
139 /* PA-RISC locks requires 16-byte alignment */
140 . = ALIGN(16);
141 .data..lock_aligned : {
142 *(.data..lock_aligned)
143 }
144
145 /* End of data section */
146 _edata = .;
147
148 /* BSS */
149 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
150
151 . = ALIGN(HUGEPAGE_SIZE);
152 _end = . ;
153
154 STABS_DEBUG
155 .note 0 : { *(.note) }
156
157 /* Sections to be discarded */
158 DISCARDS
159 /DISCARD/ : {
160#ifdef CONFIG_64BIT
161 /* temporary hack until binutils is fixed to not emit these
162 * for static binaries
163 */
164 *(.interp)
165 *(.dynsym)
166 *(.dynstr)
167 *(.dynamic)
168 *(.hash)
169 *(.gnu.hash)
170#endif
171 }
172}