projects/linux·blob master · refs

174 lines · 3.3 KiB

1/* SPDX-License-Identifier: GPL-2.0 */
2#include <asm-generic/vmlinux.lds.h>
3#include <asm/vmlinux.lds.h>
4#include <asm/thread_info.h>
5#include <asm/page.h>
6#include <asm/sclp.h>
7#include "boot.h"
8
9OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
10OUTPUT_ARCH(s390:64-bit)
11
12ENTRY(startup)
13
14SECTIONS
15{
16 . = 0;
17 .ipldata : {
18 *(.ipldata)
19 }
20 . = IPL_START;
21 .head.text : {
22 _head = . ;
23 HEAD_TEXT
24 _ehead = . ;
25 }
26 . = PARMAREA;
27 .parmarea : {
28 *(.parmarea)
29 }
30 .text : {
31 _text = .; /* Text */
32 *(.text)
33 *(.text.*)
34 *(.noinstr.text)
35 INIT_TEXT
36 _etext = . ;
37 }
38 .rodata : {
39 _rodata = . ;
40 *(.rodata) /* read-only data */
41 *(.rodata.*)
42 _erodata = . ;
43 }
44 EXCEPTION_TABLE(16)
45 .got : {
46 *(.got)
47 }
48 NOTES
49 .data : {
50 _data = . ;
51 *(.data)
52 *(.data.*)
53 _edata = . ;
54 }
55
56 BOOT_DATA
57 BOOT_DATA_PRESERVED
58
59 /*
60 * This is the BSS section of the decompressor and not of the decompressed Linux kernel.
61 * It will consume place in the decompressor's image.
62 */
63 . = ALIGN(8);
64 .bss : {
65 _bss = . ;
66 *(.bss)
67 *(.bss.*)
68 *(COMMON)
69 /*
70 * Stacks for the decompressor
71 */
72 . = ALIGN(PAGE_SIZE);
73 _dump_info_stack_start = .;
74 . += PAGE_SIZE;
75 _dump_info_stack_end = .;
76 . = ALIGN(PAGE_SIZE);
77 _stack_start = .;
78 . += BOOT_STACK_SIZE;
79 _stack_end = .;
80 _ebss = .;
81 }
82
83 /*
84 * uncompressed image info used by the decompressor it should match
85 * struct vmlinux_info. It comes from .vmlinux.info section of
86 * uncompressed vmlinux in a form of info.o
87 */
88 . = ALIGN(8);
89 .vmlinux.info : {
90 _vmlinux_info = .;
91 *(.vmlinux.info)
92 }
93
94 .decompressor.syms : {
95 . += 1; /* make sure we have \0 before the first entry */
96 . = ALIGN(2);
97 _decompressor_syms_start = .;
98 *(.decompressor.syms)
99 _decompressor_syms_end = .;
100 }
101
102 _decompressor_end = .;
103
104 . = ALIGN(4);
105 .vmlinux.relocs : {
106 __vmlinux_relocs_64_start = .;
107 *(.vmlinux.relocs_64)
108 __vmlinux_relocs_64_end = .;
109 }
110
111#ifdef CONFIG_KERNEL_UNCOMPRESSED
112 . = ALIGN(PAGE_SIZE);
113 . += AMODE31_SIZE; /* .amode31 section */
114
115 /*
116 * Make sure the location counter is not less than TEXT_OFFSET.
117 * _SEGMENT_SIZE is not available, use ALIGN(1 << 20) instead.
118 */
119 . = MAX(TEXT_OFFSET, ALIGN(1 << 20));
120#else
121 . = ALIGN(8);
122#endif
123 .rodata.compressed : {
124 _compressed_start = .;
125 *(.vmlinux.bin.compressed)
126 _compressed_end = .;
127 }
128
129#define SB_TRAILER_SIZE 32
130 /* Trailer needed for Secure Boot */
131 . += SB_TRAILER_SIZE; /* make sure .sb.trailer does not overwrite the previous section */
132 . = ALIGN(4096) - SB_TRAILER_SIZE;
133 .sb.trailer : {
134 QUAD(0)
135 QUAD(0)
136 QUAD(0)
137 QUAD(0x000000207a49504c)
138 }
139 _end = .;
140
141 /* Sections to be discarded */
142 /DISCARD/ : {
143 COMMON_DISCARDS
144 *(.eh_frame)
145 *(*__ksymtab*)
146 *(___kcrctab*)
147 *(.modinfo)
148 }
149
150 DWARF_DEBUG
151 ELF_DETAILS
152
153 /*
154 * Make sure that the .got.plt is either completely empty or it
155 * contains only the three reserved double words.
156 */
157 .got.plt : {
158 *(.got.plt)
159 }
160 ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")
161
162 /*
163 * Sections that should stay zero sized, which is safer to
164 * explicitly check instead of blindly discarding.
165 */
166 .plt : {
167 *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
168 }
169 ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
170 .rela.dyn : {
171 *(.rela.*) *(.rela_*)
172 }
173 ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
174}