1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Kernel link layout for various "sections"
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>
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).
17 #define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \
21 #define CC_USING_PATCHABLE_FUNCTION_ENTRY
22 #define RO_EXCEPTION_TABLE_ALIGN 8
24 #include <asm-generic/vmlinux.lds.h>
26 /* needed for the processor specific cache alignment size */
27 #include <asm/cache.h>
29 #include <asm/asm-offsets.h>
30 #include <asm/thread_info.h>
32 /* ld script to make hppa Linux kernel */
34 OUTPUT_FORMAT("elf32-hppa-linux")
37 OUTPUT_FORMAT("elf64-hppa-linux")
38 OUTPUT_ARCH(hppa:hppa2.0w)
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
46 #define MLONGCALL_KEEP(x) x
47 #define MLONGCALL_DISCARD(x)
50 ENTRY(parisc_kernel_start)
52 jiffies = jiffies_64 + 4;
58 . = KERNEL_BINARY_TEXT_START;
62 MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
65 INIT_DATA_SECTION(PAGE_SIZE)
66 MLONGCALL_DISCARD(EXIT_TEXT_SECTIONS())
74 __alt_instructions = .;
76 __alt_instructions_end = .;
78 . = ALIGN(HUGEPAGE_SIZE);
80 /* freed after init ends here */
82 _text = .; /* Text and read-only data */
84 MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
85 .text ALIGN(PAGE_SIZE) : {
95 *(.text.do_sigaltstack)
98 *($$*) /* millicode routines */
101 *(.lock.text) /* out-of-line lock text */
104 MLONGCALL_KEEP(EXIT_TEXT_SECTIONS())
105 . = ALIGN(PAGE_SIZE);
107 /* End of text section */
109 /* Start of data section */
112 /* Architecturally we need to keep __gp below 0x1000000 and thus
113 * in front of RO_DATA() which stores lots of tracepoint
114 * and ftrace symbols. */
122 } PROVIDE (__gp = .);
135 __start___unwind = .;
141 /* Make sure this is page aligned so
142 * that we can properly leave these
145 . = ALIGN(HUGEPAGE_SIZE);
149 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
151 /* PA-RISC locks requires 16-byte alignment */
153 .data..lock_aligned : {
154 *(.data..lock_aligned)
157 /* End of data section */
161 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
163 . = ALIGN(HUGEPAGE_SIZE);
167 .note 0 : { *(.note) }
169 /* Sections to be discarded */
173 /* temporary hack until binutils is fixed to not emit these
174 * for static binaries