Linux 6.14-rc1
[linux.git] / arch / loongarch / vdso / vdso.lds.S
blob160cfaef2de45b1243502c7356f8a913658548fe
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Author: Huacai Chen <chenhuacai@loongson.cn>
4  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
5  */
6 #include <asm/page.h>
7 #include <generated/asm-offsets.h>
9 OUTPUT_FORMAT("elf64-loongarch", "elf64-loongarch", "elf64-loongarch")
11 OUTPUT_ARCH(loongarch)
13 SECTIONS
15         PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
16 #ifdef CONFIG_TIME_NS
17         PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
18 #endif
19         PROVIDE(_loongarch_data = _vdso_data + 2 * PAGE_SIZE);
20         . = SIZEOF_HEADERS;
22         .hash           : { *(.hash) }                  :text
23         .gnu.hash       : { *(.gnu.hash) }
24         .dynsym         : { *(.dynsym) }
25         .dynstr         : { *(.dynstr) }
26         .gnu.version    : { *(.gnu.version) }
27         .gnu.version_d  : { *(.gnu.version_d) }
28         .gnu.version_r  : { *(.gnu.version_r) }
30         .note           : { *(.note.*) }                :text :note
32         .text           : { *(.text*) }                 :text
33         PROVIDE (__etext = .);
34         PROVIDE (_etext = .);
35         PROVIDE (etext = .);
37         .eh_frame_hdr   : { *(.eh_frame_hdr) }          :text :eh_frame_hdr
38         .eh_frame       : { KEEP (*(.eh_frame)) }       :text
40         .dynamic        : { *(.dynamic) }               :text :dynamic
42         .rodata         : { *(.rodata*) }               :text
44         _end = .;
45         PROVIDE(end = .);
47         /DISCARD/       : {
48                 *(.gnu.attributes)
49                 *(.note.GNU-stack)
50                 *(.data .data.* .gnu.linkonce.d.* .sdata*)
51                 *(.bss .sbss .dynbss .dynsbss)
52         }
55 PHDRS
57         text            PT_LOAD         FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
58         dynamic         PT_DYNAMIC      FLAGS(4);               /* PF_R */
59         note            PT_NOTE         FLAGS(4);               /* PF_R */
60         eh_frame_hdr    PT_GNU_EH_FRAME;
63 VERSION
65         LINUX_5.10 {
66         global:
67                 __vdso_getcpu;
68                 __vdso_clock_getres;
69                 __vdso_clock_gettime;
70                 __vdso_gettimeofday;
71                 __vdso_getrandom;
72                 __vdso_rt_sigreturn;
73         local: *;
74         };
78  * Make the sigreturn code visible to the kernel.
79  */
80 VDSO_sigreturn          = __vdso_rt_sigreturn;