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