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