| 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> |
| 8 | #include <vdso/datapage.h> |
| 9 | |
| 10 | OUTPUT_ARCH(loongarch) |
| 11 | |
| 12 | SECTIONS |
| 13 | { |
| 14 | VDSO_VVAR_SYMS |
| 15 | |
| 16 | . = SIZEOF_HEADERS; |
| 17 | |
| 18 | .hash : { *(.hash) } :text |
| 19 | .gnu.hash : { *(.gnu.hash) } |
| 20 | .dynsym : { *(.dynsym) } |
| 21 | .dynstr : { *(.dynstr) } |
| 22 | .gnu.version : { *(.gnu.version) } |
| 23 | .gnu.version_d : { *(.gnu.version_d) } |
| 24 | .gnu.version_r : { *(.gnu.version_r) } |
| 25 | |
| 26 | .note : { *(.note.*) } :text :note |
| 27 | |
| 28 | .text : { *(.text*) } :text |
| 29 | PROVIDE (__etext = .); |
| 30 | PROVIDE (_etext = .); |
| 31 | PROVIDE (etext = .); |
| 32 | |
| 33 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
| 34 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
| 35 | |
| 36 | .dynamic : { *(.dynamic) } :text :dynamic |
| 37 | |
| 38 | .rodata : { *(.rodata*) } :text |
| 39 | |
| 40 | _end = .; |
| 41 | PROVIDE(end = .); |
| 42 | |
| 43 | /DISCARD/ : { |
| 44 | *(.gnu.attributes) |
| 45 | *(.note.GNU-stack) |
| 46 | *(.data .data.* .gnu.linkonce.d.* .sdata*) |
| 47 | *(.bss .sbss .dynbss .dynsbss) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | PHDRS |
| 52 | { |
| 53 | text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */ |
| 54 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
| 55 | note PT_NOTE FLAGS(4); /* PF_R */ |
| 56 | eh_frame_hdr PT_GNU_EH_FRAME; |
| 57 | } |
| 58 | |
| 59 | VERSION |
| 60 | { |
| 61 | LINUX_5.10 { |
| 62 | global: |
| 63 | __vdso_getcpu; |
| 64 | #ifdef CONFIG_GENERIC_GETTIMEOFDAY |
| 65 | __vdso_clock_getres; |
| 66 | __vdso_clock_gettime; |
| 67 | __vdso_gettimeofday; |
| 68 | #endif |
| 69 | __vdso_getrandom; |
| 70 | __vdso_rt_sigreturn; |
| 71 | local: *; |
| 72 | }; |
| 73 | } |
| 74 | |
| 75 | /* |
| 76 | * Make the sigreturn code visible to the kernel. |
| 77 | */ |
| 78 | VDSO_sigreturn = __vdso_rt_sigreturn; |
| 79 | |