^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #include <asm/vmlinux.lds.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) OUTPUT_FORMAT(ELF_FORMAT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) OUTPUT_ARCH(ELF_ARCH)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ENTRY(_start)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) jiffies = jiffies_64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) VERSION {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) local: *;
^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)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) SECTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* This must contain the right address - not quite the default ELF one.*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) PROVIDE (__executable_start = START);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* Static binaries stick stuff here, like the sigreturn trampoline,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * invisibly to objdump. So, just make __binary_start equal to the very
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * beginning of the executable, and if there are unmapped pages after this,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * they are forever unusable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) __binary_start = START;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) . = START + SIZEOF_HEADERS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) . = ALIGN(PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) _text = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) INIT_TEXT_SECTION(0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) .text :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) _stext = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) TEXT_TEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) SCHED_TEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) CPUIDLE_TEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) LOCK_TEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) IRQENTRY_TEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) SOFTIRQENTRY_TEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) *(.fixup)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) /* .gnu.warning sections are handled specially by elf32.em. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) *(.gnu.warning)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) *(.gnu.linkonce.t*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) . = ALIGN(PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) .syscall_stub : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) __syscall_stub_start = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) *(.__syscall_stub*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) __syscall_stub_end = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * These are needed even in a static link, even if they wind up being empty.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * Newer glibc needs these __rel{,a}_iplt_{start,end} symbols.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) .rel.plt : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) *(.rel.plt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) PROVIDE_HIDDEN(__rel_iplt_start = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) *(.rel.iplt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) PROVIDE_HIDDEN(__rel_iplt_end = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) .rela.plt : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) *(.rela.plt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) PROVIDE_HIDDEN(__rela_iplt_start = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) *(.rela.iplt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) PROVIDE_HIDDEN(__rela_iplt_end = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #include <asm/common.lds.S>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) __init_begin = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) init.data : { INIT_DATA }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) __init_end = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) .data :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) INIT_TASK_DATA(KERNEL_STACK_SIZE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) . = ALIGN(KERNEL_STACK_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) *(.data..init_irqstack)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) DATA_DATA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) *(.gnu.linkonce.d*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) CONSTRUCTORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) .data1 : { *(.data1) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) .ctors :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) *(.ctors)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) .dtors :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) *(.dtors)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) .got : { *(.got.plt) *(.got) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) .dynamic : { *(.dynamic) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) /* We want the small data sections together, so single-instruction offsets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) can access them all, and initialized data all before uninitialized, so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) we can shorten the on-disk segment size. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) .sdata : { *(.sdata) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) _edata = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) PROVIDE (edata = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) . = ALIGN(PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) __bss_start = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) PROVIDE(_bss_start = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) SBSS(0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) BSS(0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) __bss_stop = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) _end = .;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) PROVIDE (end = .);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) STABS_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) DWARF_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) ELF_DETAILS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) DISCARDS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) }