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 
9 OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
10 OUTPUT_ARCH(s390:64-bit)
11 
12 ENTRY(startup)
13 
14 SECTIONS
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 		_etext = . ;
35 	}
36 	.rodata : {
37 		_rodata = . ;
38 		*(.rodata)	 /* read-only data */
39 		*(.rodata.*)
40 		_erodata = . ;
41 	}
42 	NOTES
43 	.data :	{
44 		_data = . ;
45 		*(.data)
46 		*(.data.*)
47 		_edata = . ;
48 	}
49 
50 	BOOT_DATA
51 	BOOT_DATA_PRESERVED
52 
53 	/*
54 	 * This is the BSS section of the decompressor and not of the decompressed Linux kernel.
55 	 * It will consume place in the decompressor's image.
56 	 */
57 	. = ALIGN(8);
58 	.bss : {
59 		_bss = . ;
60 		*(.bss)
61 		*(.bss.*)
62 		*(COMMON)
63 		/*
64 		 * Stacks for the decompressor
65 		 */
66 		. = ALIGN(PAGE_SIZE);
67 		_dump_info_stack_start = .;
68 		. += PAGE_SIZE;
69 		_dump_info_stack_end = .;
70 		. = ALIGN(PAGE_SIZE);
71 		_stack_start = .;
72 		. += BOOT_STACK_SIZE;
73 		_stack_end = .;
74 		_ebss = .;
75 	}
76 
77 	/*
78 	 * uncompressed image info used by the decompressor it should match
79 	 * struct vmlinux_info. It comes from .vmlinux.info section of
80 	 * uncompressed vmlinux in a form of info.o
81 	 */
82 	. = ALIGN(8);
83 	.vmlinux.info : {
84 		_vmlinux_info = .;
85 		*(.vmlinux.info)
86 	}
87 
88 	.decompressor.syms : {
89 		. += 1; /* make sure we have \0 before the first entry */
90 		. = ALIGN(2);
91 		_decompressor_syms_start = .;
92 		*(.decompressor.syms)
93 		_decompressor_syms_end = .;
94 	}
95 
96 	_decompressor_end = .;
97 
98 #ifdef CONFIG_KERNEL_UNCOMPRESSED
99 	. = 0x100000;
100 #else
101 	. = ALIGN(8);
102 #endif
103 	.rodata.compressed : {
104 		_compressed_start = .;
105 		*(.vmlinux.bin.compressed)
106 		_compressed_end = .;
107 	}
108 
109 #define SB_TRAILER_SIZE 32
110 	/* Trailer needed for Secure Boot */
111 	. += SB_TRAILER_SIZE; /* make sure .sb.trailer does not overwrite the previous section */
112 	. = ALIGN(4096) - SB_TRAILER_SIZE;
113 	.sb.trailer : {
114 		QUAD(0)
115 		QUAD(0)
116 		QUAD(0)
117 		QUAD(0x000000207a49504c)
118 	}
119 	_end = .;
120 
121 	/* Sections to be discarded */
122 	/DISCARD/ : {
123 		*(.eh_frame)
124 		*(__ex_table)
125 		*(*__ksymtab*)
126 		*(___kcrctab*)
127 	}
128 }
129