2 * GNU linker script for the VDSO library.
4 * Copyright (C) 2012 ARM Limited
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * Author: Will Deacon <will.deacon@arm.com>
19 * Heavily based on the vDSO linker scripts for other archs.
22 #include <linux/const.h>
26 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
31 PROVIDE(_vdso_data = . - PAGE_SIZE);
32 . = VDSO_LBASE + SIZEOF_HEADERS;
34 .hash : { *(.hash) } :text
35 .gnu.hash : { *(.gnu.hash) }
36 .dynsym : { *(.dynsym) }
37 .dynstr : { *(.dynstr) }
38 .gnu.version : { *(.gnu.version) }
39 .gnu.version_d : { *(.gnu.version_d) }
40 .gnu.version_r : { *(.gnu.version_r) }
42 .note : { *(.note.*) } :text :note
46 .text : { *(.text*) } :text =0xd503201f
47 PROVIDE (__etext = .);
51 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
52 .eh_frame : { KEEP (*(.eh_frame)) } :text
54 .dynamic : { *(.dynamic) } :text :dynamic
56 .rodata : { *(.rodata*) } :text
63 *(.data .data.* .gnu.linkonce.d.* .sdata*)
64 *(.bss .sbss .dynbss .dynsbss)
69 * We must supply the ELF program headers explicitly to get just one
70 * PT_LOAD segment, and set the flags explicitly to make segments read-only.
74 text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
75 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
76 note PT_NOTE FLAGS(4); /* PF_R */
77 eh_frame_hdr PT_GNU_EH_FRAME;
81 * This controls what symbols we export from the DSO.
87 __kernel_rt_sigreturn;
88 __kernel_gettimeofday;
89 __kernel_clock_gettime;
90 __kernel_clock_getres;
96 * Make the sigreturn code visible to the kernel.
98 VDSO_sigtramp = __kernel_rt_sigreturn;