1#include <asm/vmlinux.lds.h> 2#include <asm/page.h> 3 4OUTPUT_FORMAT(ELF_FORMAT) 5OUTPUT_ARCH(ELF_ARCH) 6ENTRY(_start) 7jiffies = jiffies_64; 8 9VERSION { 10 { 11 local: *; 12 }; 13} 14 15SECTIONS 16{ 17 PROVIDE (__executable_start = START); 18 . = START + SIZEOF_HEADERS; 19 .interp : { *(.interp) } 20 __binary_start = .; 21 . = ALIGN(4096); /* Init code and data */ 22 _text = .; 23 __init_begin = .; 24 INIT_TEXT_SECTION(PAGE_SIZE) 25 26 init.data : { INIT_DATA } 27 . = ALIGN(PAGE_SIZE); 28 __init_end = .; 29 30 /* Read-only sections, merged into text segment: */ 31 .hash : { *(.hash) } 32 .gnu.hash : { *(.gnu.hash) } 33 .dynsym : { *(.dynsym) } 34 .dynstr : { *(.dynstr) } 35 .gnu.version : { *(.gnu.version) } 36 .gnu.version_d : { *(.gnu.version_d) } 37 .gnu.version_r : { *(.gnu.version_r) } 38 .rel.init : { *(.rel.init) } 39 .rela.init : { *(.rela.init) } 40 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } 41 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } 42 .rel.fini : { *(.rel.fini) } 43 .rela.fini : { *(.rela.fini) } 44 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } 45 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } 46 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } 47 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } 48 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } 49 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } 50 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } 51 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } 52 .rel.ctors : { *(.rel.ctors) } 53 .rela.ctors : { *(.rela.ctors) } 54 .rel.dtors : { *(.rel.dtors) } 55 .rela.dtors : { *(.rela.dtors) } 56 .rel.got : { *(.rel.got) } 57 .rela.got : { *(.rela.got) } 58 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } 59 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } 60 .rel.plt : { 61 *(.rel.plt) 62 PROVIDE_HIDDEN(__rel_iplt_start = .); 63 *(.rel.iplt) 64 PROVIDE_HIDDEN(__rel_iplt_end = .); 65 } 66 .rela.plt : { 67 *(.rela.plt) 68 PROVIDE_HIDDEN(__rela_iplt_start = .); 69 *(.rela.iplt) 70 PROVIDE_HIDDEN(__rela_iplt_end = .); 71 } 72 .init : { 73 KEEP (*(.init)) 74 } =0x90909090 75 .plt : { *(.plt) } 76 .text : { 77 _stext = .; 78 TEXT_TEXT 79 SCHED_TEXT 80 LOCK_TEXT 81 IRQENTRY_TEXT 82 SOFTIRQENTRY_TEXT 83 *(.fixup) 84 *(.stub .text.* .gnu.linkonce.t.*) 85 /* .gnu.warning sections are handled specially by elf32.em. */ 86 *(.gnu.warning) 87 88 . = ALIGN(PAGE_SIZE); 89 } =0x90909090 90 . = ALIGN(PAGE_SIZE); 91 .syscall_stub : { 92 __syscall_stub_start = .; 93 *(.__syscall_stub*) 94 __syscall_stub_end = .; 95 } 96 .fini : { 97 KEEP (*(.fini)) 98 } =0x90909090 99 100 .kstrtab : { *(.kstrtab) } 101 102 #include <asm/common.lds.S> 103 104 /* Ensure the __preinit_array_start label is properly aligned. We 105 could instead move the label definition inside the section, but 106 the linker would then create the section even if it turns out to 107 be empty, which isn't pretty. */ 108 . = ALIGN(32 / 8); 109 .preinit_array : { *(.preinit_array) } 110 .init_array : { 111 *(.kasan_init) 112 *(.init_array.*) 113 *(.init_array) 114 } 115 .fini_array : { *(.fini_array) } 116 .data : { 117 INIT_TASK_DATA(KERNEL_STACK_SIZE) 118 DATA_DATA 119 *(.ldata .ldata.[0-9a-zA-Z_]* .ldata..L*) 120 *(.data.* .gnu.linkonce.d.*) 121 SORT(CONSTRUCTORS) 122 } 123 .data1 : { *(.data1) } 124 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } 125 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } 126 .eh_frame : { KEEP (*(.eh_frame)) } 127 .gcc_except_table : { *(.gcc_except_table) } 128 .dynamic : { *(.dynamic) } 129 .ctors : { 130 /* gcc uses crtbegin.o to find the start of 131 the constructors, so we make sure it is 132 first. Because this is a wildcard, it 133 doesn't matter if the user does not 134 actually link against crtbegin.o; the 135 linker won't look for a file to match a 136 wildcard. The wildcard also means that it 137 doesn't matter which directory crtbegin.o 138 is in. */ 139 KEEP (*crtbegin.o(.ctors)) 140 /* We don't want to include the .ctor section from 141 from the crtend.o file until after the sorted ctors. 142 The .ctor section from the crtend file contains the 143 end of ctors marker and it must be last */ 144 KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) 145 KEEP (*(SORT(.ctors.*))) 146 KEEP (*(.ctors)) 147 } 148 .dtors : { 149 KEEP (*crtbegin.o(.dtors)) 150 KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) 151 KEEP (*(SORT(.dtors.*))) 152 KEEP (*(.dtors)) 153 } 154 .jcr : { KEEP (*(.jcr)) } 155 .got : { *(.got.plt) *(.got) } 156 _edata = .; 157 PROVIDE (edata = .); 158 .bss : { 159 __bss_start = .; 160 *(.dynbss) 161 *(.bss .bss.* .gnu.linkonce.b.*) 162 *(.lbss .lbss.[0-9a-zA-Z_]* .lbss..L*) 163 *(COMMON) 164 /* Align here to ensure that the .bss section occupies space up to 165 _end. Align after .bss to ensure correct alignment even if the 166 .bss section disappears because there are no input sections. */ 167 . = ALIGN(32 / 8); 168 . = ALIGN(32 / 8); 169 } 170 __bss_stop = .; 171 _end = .; 172 PROVIDE (end = .); 173 174 STABS_DEBUG 175 DWARF_DEBUG 176 MODINFO 177 ELF_DETAILS 178 179 DISCARDS 180} 181 182ASSERT(__syscall_stub_end - __syscall_stub_start <= PAGE_SIZE, 183 "STUB code must not be larger than one page"); 184