^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (C) 2012 Regents of the University of California
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) OUTPUT_ARCH(riscv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) SECTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) PROVIDE(_vdso_data = . + PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) . = SIZEOF_HEADERS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) .hash : { *(.hash) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) .gnu.hash : { *(.gnu.hash) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) .dynsym : { *(.dynsym) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) .dynstr : { *(.dynstr) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .gnu.version : { *(.gnu.version) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) .gnu.version_d : { *(.gnu.version_d) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) .gnu.version_r : { *(.gnu.version_r) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) .note : { *(.note.*) } :text :note
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) .dynamic : { *(.dynamic) } :text :dynamic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) .eh_frame : { KEEP (*(.eh_frame)) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * This linker script is used both with -r and with -shared.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * For the layouts to match, we need to skip more than enough
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * space for the dynamic symbol table, etc. If this amount is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * insufficient, ld -shared will error; simply increase it here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) . = 0x800;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) .text : { *(.text .text.*) } :text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) .data : {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) *(.got.plt) *(.got)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) *(.data .data.* .gnu.linkonce.d.*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) *(.dynbss)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) *(.bss .bss.* .gnu.linkonce.b.*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) }
^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) * We must supply the ELF program headers explicitly to get just one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * PT_LOAD segment, and set the flags explicitly to make segments read-only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) PHDRS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) note PT_NOTE FLAGS(4); /* PF_R */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) eh_frame_hdr PT_GNU_EH_FRAME;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) * This controls what symbols we export from the DSO.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) VERSION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) LINUX_4.15 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) global:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) __vdso_rt_sigreturn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) __vdso_gettimeofday;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) __vdso_clock_gettime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) __vdso_clock_getres;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) __vdso_getcpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) __vdso_flush_icache;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) local: *;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) }