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
8OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
9OUTPUT_ARCH(s390:64-bit)
10
11ENTRY(startup)
12
13SECTIONS
14{
15	. = 0;
16	.head.text : {
17		_head = . ;
18		HEAD_TEXT
19		_ehead = . ;
20	}
21	.text :	{
22		_text = .;	/* Text */
23		*(.text)
24		*(.text.*)
25		_etext = . ;
26	}
27	.rodata : {
28		_rodata = . ;
29		*(.rodata)	 /* read-only data */
30		*(.rodata.*)
31		_erodata = . ;
32	}
33	NOTES
34	.data :	{
35		_data = . ;
36		*(.data)
37		*(.data.*)
38		_edata = . ;
39	}
40
41	BOOT_DATA
42	BOOT_DATA_PRESERVED
43
44	/*
45	 * This is the BSS section of the decompressor and not of the decompressed Linux kernel.
46	 * It will consume place in the decompressor's image.
47	 */
48	. = ALIGN(8);
49	.bss : {
50		_bss = . ;
51		*(.bss)
52		*(.bss.*)
53		*(COMMON)
54		/*
55		 * Stacks for the decompressor
56		 */
57		. = ALIGN(PAGE_SIZE);
58		_dump_info_stack_start = .;
59		. += PAGE_SIZE;
60		_dump_info_stack_end = .;
61		. = ALIGN(PAGE_SIZE);
62		_stack_start = .;
63		. += BOOT_STACK_SIZE;
64		_stack_end = .;
65		_ebss = .;
66	}
67
68	/*
69	 * uncompressed image info used by the decompressor it should match
70	 * struct vmlinux_info. It comes from .vmlinux.info section of
71	 * uncompressed vmlinux in a form of info.o
72	 */
73	. = ALIGN(8);
74	.vmlinux.info : {
75		_vmlinux_info = .;
76		*(.vmlinux.info)
77	}
78
79	.decompressor.syms : {
80		. += 1; /* make sure we have \0 before the first entry */
81		. = ALIGN(2);
82		_decompressor_syms_start = .;
83		*(.decompressor.syms)
84		_decompressor_syms_end = .;
85	}
86
87#ifdef CONFIG_KERNEL_UNCOMPRESSED
88	. = 0x100000;
89#else
90	. = ALIGN(8);
91#endif
92	.rodata.compressed : {
93		_compressed_start = .;
94		*(.vmlinux.bin.compressed)
95		_compressed_end = .;
96		FILL(0xff);
97		. = ALIGN(4096);
98	}
99	_end = .;
100
101	/* Sections to be discarded */
102	/DISCARD/ : {
103		*(.eh_frame)
104		*(__ex_table)
105		*(*__ksymtab*)
106		*(___kcrctab*)
107	}
108}
109