^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) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Linker script for vDSO. This is an ELF shared object prelinked to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * its virtual address, and with only one read-only segment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * This script controls its layout.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) SECTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) . = VDSO_PRELINK + SIZEOF_HEADERS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) .hash : { *(.hash) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) .gnu.hash : { *(.gnu.hash) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) .dynsym : { *(.dynsym) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) .dynstr : { *(.dynstr) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) .gnu.version : { *(.gnu.version) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) .gnu.version_d : { *(.gnu.version_d) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .gnu.version_r : { *(.gnu.version_r) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) .note : { *(.note.*) } :text :note
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) .eh_frame : { KEEP (*(.eh_frame)) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) .dynamic : { *(.dynamic) } :text :dynamic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) .rodata : { *(.rodata*) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) .data : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) *(.data*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) *(.sdata*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) *(.got.plt) *(.got)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) *(.gnu.linkonce.d.*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) *(.bss*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) *(.dynbss*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) *(.gnu.linkonce.b.*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) .altinstructions : { *(.altinstructions) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) .altinstr_replacement : { *(.altinstr_replacement) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * Align the actual code well away from the non-instruction data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * This is the best thing for the I-cache.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) . = ALIGN(0x100);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) .text : { *(.text*) } :text =0x90909090
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * Very old versions of ld do not recognize this name token; use the constant.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #define PT_GNU_EH_FRAME 0x6474e550
^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) * We must supply the ELF program headers explicitly to get just one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * PT_LOAD segment, and set the flags explicitly to make segments read-only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) PHDRS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) note PT_NOTE FLAGS(4); /* PF_R */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) eh_frame_hdr PT_GNU_EH_FRAME;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) }