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 #include <asm-generic/vmlinux.lds.h>
23 /* needed for the processor specific cache alignment size */
24 #include <asm/cache.h>
26 #include <asm/asm-offsets.h>
27 #include <asm/thread_info.h>
29 /* ld script to make hppa Linux kernel */
31 OUTPUT_FORMAT("elf32-hppa-linux")
34 OUTPUT_FORMAT("elf64-hppa-linux")
35 OUTPUT_ARCH(hppa:hppa2.0w)
38 ENTRY(parisc_kernel_start)
40 jiffies = jiffies_64 + 4;
46 . = KERNEL_BINARY_TEXT_START;
53 INIT_DATA_SECTION(PAGE_SIZE)
54 /* we have to discard exit text and such at runtime, not link time */
64 . = ALIGN(HUGEPAGE_SIZE);
66 /* freed after init ends here */
68 _text = .; /* Text and read-only data */
70 .text ALIGN(PAGE_SIZE) : {
80 *(.text.do_sigaltstack)
83 *($$*) /* millicode routines */
86 *(.lock.text) /* out-of-line lock text */
91 /* End of text section */
93 /* Start of data section */
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. */
106 } PROVIDE (__gp = .);
117 /* RO because of BUILDTIME_EXTABLE_SORT */
123 __start___unwind = .;
129 /* Make sure this is page aligned so
130 * that we can properly leave these
133 . = ALIGN(HUGEPAGE_SIZE);
137 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
139 /* PA-RISC locks requires 16-byte alignment */
141 .data..lock_aligned : {
142 *(.data..lock_aligned)
145 /* End of data section */
149 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
151 . = ALIGN(HUGEPAGE_SIZE);
155 .note 0 : { *(.note) }
157 /* Sections to be discarded */
161 /* temporary hack until binutils is fixed to not emit these
162 * for static binaries