s390/decompressor: add symbols support
[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
5 OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
6 OUTPUT_ARCH(s390:64-bit)
7
8 ENTRY(startup)
9
10 SECTIONS
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         .decompressor.syms : {
86                 . += 1; /* make sure we have \0 before the first entry */
87                 . = ALIGN(2);
88                 _decompressor_syms_start = .;
89                 *(.decompressor.syms)
90                 _decompressor_syms_end = .;
91         }
92
93 #ifdef CONFIG_KERNEL_UNCOMPRESSED
94         . = 0x100000;
95 #else
96         . = ALIGN(8);
97 #endif
98         .rodata.compressed : {
99                 _compressed_start = .;
100                 *(.vmlinux.bin.compressed)
101                 _compressed_end = .;
102                 FILL(0xff);
103                 . = ALIGN(4096);
104         }
105         _end = .;
106
107         /* Sections to be discarded */
108         /DISCARD/ : {
109                 *(.eh_frame)
110                 *(__ex_table)
111                 *(*__ksymtab*)
112                 *(___kcrctab*)
113         }
114 }