• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0 */
2#include <asm-generic/vmlinux.lds.h>
3#include <asm/vmlinux.lds.h>
4
5OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
6OUTPUT_ARCH(s390:64-bit)
7
8ENTRY(startup)
9
10SECTIONS
11{
12	. = 0;
13	.head.text : {
14		_head = . ;
15		HEAD_TEXT
16		_ehead = . ;
17	}
18	.text :	{
19		_text = .;	/* Text */
20		*(.text)
21		*(.text.*)
22		_etext = . ;
23	}
24	.rodata : {
25		_rodata = . ;
26		*(.rodata)	 /* read-only data */
27		*(.rodata.*)
28		_erodata = . ;
29	}
30	.data :	{
31		_data = . ;
32		*(.data)
33		*(.data.*)
34		_edata = . ;
35	}
36	/*
37	* .dma section for code, data, ex_table that need to stay below 2 GB,
38	* even when the kernel is relocate: above 2 GB.
39	*/
40	. = ALIGN(PAGE_SIZE);
41	_sdma = .;
42	.dma.text : {
43		_stext_dma = .;
44		*(.dma.text)
45		. = ALIGN(PAGE_SIZE);
46		_etext_dma = .;
47	}
48	. = ALIGN(16);
49	.dma.ex_table : {
50		_start_dma_ex_table = .;
51		KEEP(*(.dma.ex_table))
52		_stop_dma_ex_table = .;
53	}
54	.dma.data : { *(.dma.data) }
55	. = ALIGN(PAGE_SIZE);
56	_edma = .;
57
58	BOOT_DATA
59	BOOT_DATA_PRESERVED
60
61	/*
62	 * This is the BSS section of the decompressor and not of the decompressed Linux kernel.
63	 * It will consume place in the decompressor's image.
64	 */
65	. = ALIGN(8);
66	.bss : {
67		_bss = . ;
68		*(.bss)
69		*(.bss.*)
70		*(COMMON)
71		_ebss = .;
72	}
73
74	/*
75	 * uncompressed image info used by the decompressor it should match
76	 * struct vmlinux_info. It comes from .vmlinux.info section of
77	 * uncompressed vmlinux in a form of info.o
78	 */
79	. = ALIGN(8);
80	.vmlinux.info : {
81		_vmlinux_info = .;
82		*(.vmlinux.info)
83	}
84
85#ifdef CONFIG_KERNEL_UNCOMPRESSED
86	. = 0x100000;
87#else
88	. = ALIGN(8);
89#endif
90	.rodata.compressed : {
91		_compressed_start = .;
92		*(.vmlinux.bin.compressed)
93		_compressed_end = .;
94	}
95
96#define SB_TRAILER_SIZE 32
97	/* Trailer needed for Secure Boot */
98	. += SB_TRAILER_SIZE; /* make sure .sb.trailer does not overwrite the previous section */
99	. = ALIGN(4096) - SB_TRAILER_SIZE;
100	.sb.trailer : {
101		QUAD(0)
102		QUAD(0)
103		QUAD(0)
104		QUAD(0x000000207a49504c)
105	}
106	_end = .;
107
108	/* Sections to be discarded */
109	/DISCARD/ : {
110		*(.eh_frame)
111		*(__ex_table)
112		*(*__ksymtab*)
113		*(___kcrctab*)
114	}
115}
116