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