1/* ELF symbol initialization functions for VDSO objects. Linux version.
2 Copyright (C) 2020-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library 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 GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _DL_VDSO_INIT_H
20#define _DL_VDSO_INIT_H
21
22/* Initialize the VDSO functions pointers. */
23static inline void __attribute__ ((always_inline))
24setup_vdso_pointers (void)
25{
26#ifdef HAVE_CLOCK_GETTIME_VSYSCALL
27 GLRO(dl_vdso_clock_gettime) = dl_vdso_vsym (HAVE_CLOCK_GETTIME_VSYSCALL);
28#endif
29#ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
30 GLRO(dl_vdso_clock_gettime64) = dl_vdso_vsym (HAVE_CLOCK_GETTIME64_VSYSCALL);
31#endif
32#ifdef HAVE_GETTIMEOFDAY_VSYSCALL
33 GLRO(dl_vdso_gettimeofday) = dl_vdso_vsym (HAVE_GETTIMEOFDAY_VSYSCALL);
34#endif
35#ifdef HAVE_TIME_VSYSCALL
36 GLRO(dl_vdso_time) = dl_vdso_vsym (HAVE_TIME_VSYSCALL);
37#endif
38#ifdef HAVE_GETCPU_VSYSCALL
39 GLRO(dl_vdso_getcpu) = dl_vdso_vsym (HAVE_GETCPU_VSYSCALL);
40#endif
41#ifdef HAVE_CLOCK_GETRES_VSYSCALL
42 GLRO(dl_vdso_clock_getres) = dl_vdso_vsym (HAVE_CLOCK_GETRES_VSYSCALL);
43#endif
44#ifdef HAVE_CLOCK_GETRES64_VSYSCALL
45 GLRO(dl_vdso_clock_getres_time64) = dl_vdso_vsym (HAVE_CLOCK_GETRES64_VSYSCALL);
46#endif
47#ifdef HAVE_GET_TBFREQ
48 GLRO(dl_vdso_get_tbfreq) = dl_vdso_vsym (HAVE_GET_TBFREQ);
49#endif
50}
51
52#endif
53

source code of glibc/sysdeps/unix/sysv/linux/dl-vdso-setup.h