1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * GNU linker script for the VDSO library.
5 * Copyright (C) 2012 ARM Limited
7 * Author: Will Deacon <will.deacon@arm.com>
8 * Heavily based on the vDSO linker scripts for other archs.
11 #include <linux/const.h>
15 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
20 PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
22 PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
24 . = VDSO_LBASE + SIZEOF_HEADERS;
26 .hash : { *(.hash) } :text
27 .gnu.hash : { *(.gnu.hash) }
28 .dynsym : { *(.dynsym) }
29 .dynstr : { *(.dynstr) }
30 .gnu.version : { *(.gnu.version) }
31 .gnu.version_d : { *(.gnu.version_d) }
32 .gnu.version_r : { *(.gnu.version_r) }
35 * Discard .note.gnu.property sections which are unused and have
36 * different alignment requirement from vDSO note sections.
39 *(.note.GNU-stack .note.gnu.property)
41 .note : { *(.note.*) } :text :note
45 .text : { *(.text*) } :text =0xd503201f
46 PROVIDE (__etext = .);
50 .dynamic : { *(.dynamic) } :text :dynamic
52 .rodata : { *(.rodata*) } :text
58 *(.data .data.* .gnu.linkonce.d.* .sdata*)
59 *(.bss .sbss .dynbss .dynsbss)
60 *(.eh_frame .eh_frame_hdr)
65 * We must supply the ELF program headers explicitly to get just one
66 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
70 text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
71 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
72 note PT_NOTE FLAGS(4); /* PF_R */
76 * This controls what symbols we export from the DSO.
82 __kernel_rt_sigreturn;
83 __kernel_gettimeofday;
84 __kernel_clock_gettime;
85 __kernel_clock_getres;
91 * Make the sigreturn code visible to the kernel.
93 VDSO_sigtramp = __kernel_rt_sigreturn;