1 /* ld script to make s390 Linux kernel
2 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
5 #include <asm/thread_info.h>
7 #include <asm-generic/vmlinux.lds.h>
9 OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
10 OUTPUT_ARCH(s390:64-bit)
15 text PT_LOAD FLAGS(5); /* R_E */
16 data PT_LOAD FLAGS(7); /* RWE */
17 note PT_NOTE FLAGS(0); /* ___ */
24 /* Text and read-only data */
27 * E.g. perf doesn't like symbols starting at address zero,
28 * therefore skip the initial PSW and channel program located
29 * at address zero and let _text start at 0x200.
41 _etext = .; /* End of text section */
45 .dummy : { *(.dummy) } :data
47 RO_DATA_SECTION(PAGE_SIZE)
49 #ifdef CONFIG_SHARED_KERNEL
50 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
54 _eshared = .; /* End of shareable data */
55 _sdata = .; /* Start of data section */
57 EXCEPTION_TABLE(16) :data
59 RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
61 _edata = .; /* End of data section */
63 /* will be freed after init */
64 . = ALIGN(PAGE_SIZE); /* Init code and data */
67 INIT_TEXT_SECTION(PAGE_SIZE)
70 * .exit.text is discarded at runtime, not link time,
71 * to deal with references from __bug_table
82 * struct alt_inst entries. From the header (alternative.h):
83 * "Alternative instructions for different CPU types or capabilities"
84 * Think locking instructions on spinlocks.
85 * Note, that it is a part of __init region.
89 __alt_instructions = .;
91 __alt_instructions_end = .;
95 * And here are the replacement instructions. The linker sticks
96 * them as binary blobs. The .altinstructions has enough data to
97 * get the address and the length of them to patch the kernel safely.
98 * Note, that it is a part of __init region.
100 .altinstr_replacement : {
101 *(.altinstr_replacement)
105 * Table with the patch locations to undo expolines
107 .nospec_call_table : {
108 __nospec_call_start = . ;
110 __nospec_call_end = . ;
112 .nospec_return_table : {
113 __nospec_return_start = . ;
115 __nospec_return_end = . ;
118 /* early.c uses stsi, which requires page aligned data. */
119 . = ALIGN(PAGE_SIZE);
120 INIT_DATA_SECTION(0x100)
122 PERCPU_SECTION(0x100)
123 . = ALIGN(PAGE_SIZE);
124 __init_end = .; /* freed after init ends here */
130 /* Debugging sections. */
134 /* Sections to be discarded */