]>
Commit | Line | Data |
---|---|---|
1bdda52f | 1 | /* Data for vDSO support. Linux version. |
2b778ceb | 2 | Copyright (C) 2020-2021 Free Software Foundation, Inc. |
1bdda52f AZ |
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 | /* This file is included in three different modes for both static (libc.a) | |
20 | and shared (rtld) modes: | |
21 | ||
22 | 1. PROCINFO_DECL is defined, meaning we are only interested in | |
23 | declarations. For static it requires use the extern keywork along with | |
24 | the attribute_relro while for shared it will be embedded in the | |
25 | rtld_global_ro. | |
26 | ||
27 | 2. PROCINFO_DECL and SHARED are not defined. Nothing to do, the default | |
28 | zero initializion is suffice. | |
29 | ||
30 | 3. PROCINFO_DECL is not defined while SHARED is. Similar to 2., the zero | |
31 | initialization of rtld_global_ro is suffice. */ | |
32 | ||
33 | #ifndef PROCINFO_CLASS | |
34 | # define PROCINFO_CLASS | |
35 | #endif | |
36 | ||
37 | #ifndef SHARED | |
38 | # define RELRO attribute_relro | |
39 | #else | |
40 | # define RELRO | |
41 | #endif | |
42 | ||
43 | #if defined PROCINFO_DECL || !defined SHARED | |
44 | # ifdef HAVE_CLOCK_GETTIME_VSYSCALL | |
45 | PROCINFO_CLASS int (*_dl_vdso_clock_gettime) (clockid_t, | |
46 | struct timespec *) RELRO; | |
47 | #endif | |
ff500a62 AZ |
48 | # ifdef HAVE_CLOCK_GETTIME64_VSYSCALL |
49 | PROCINFO_CLASS int (*_dl_vdso_clock_gettime64) (clockid_t, | |
50 | struct __timespec64 *) RELRO; | |
51 | #endif | |
1bdda52f AZ |
52 | # ifdef HAVE_GETTIMEOFDAY_VSYSCALL |
53 | PROCINFO_CLASS int (*_dl_vdso_gettimeofday) (struct timeval *, void *) RELRO; | |
54 | #endif | |
55 | # ifdef HAVE_TIME_VSYSCALL | |
56 | PROCINFO_CLASS time_t (*_dl_vdso_time) (time_t *) RELRO; | |
57 | # endif | |
58 | # ifdef HAVE_GETCPU_VSYSCALL | |
59 | PROCINFO_CLASS int (*_dl_vdso_getcpu) (unsigned *, unsigned *, void *) RELRO; | |
60 | # endif | |
61 | # ifdef HAVE_CLOCK_GETRES_VSYSCALL | |
62 | PROCINFO_CLASS int (*_dl_vdso_clock_getres) (clockid_t, | |
63 | struct timespec *) RELRO; | |
64 | # endif | |
0dc1a378 AZ |
65 | # ifdef HAVE_CLOCK_GETRES64_VSYSCALL |
66 | PROCINFO_CLASS int (*_dl_vdso_clock_getres_time64) (clockid_t, | |
67 | struct __timespec64 *) RELRO; | |
68 | # endif | |
1bdda52f AZ |
69 | |
70 | /* PowerPC specific ones. */ | |
71 | # ifdef HAVE_GET_TBFREQ | |
72 | PROCINFO_CLASS uint64_t (*_dl_vdso_get_tbfreq)(void) RELRO; | |
73 | # endif | |
74 | /* The sigtramp are used on powerpc backtrace without using | |
75 | INLINE_VSYSCALL, so there is no need to set their type. */ | |
76 | # ifdef HAVE_SIGTRAMP_RT64 | |
77 | PROCINFO_CLASS void *_dl_vdso_sigtramp_rt64 RELRO; | |
78 | # endif | |
79 | # ifdef HAVE_SIGTRAMP_RT32 | |
80 | PROCINFO_CLASS void *_dl_vdso_sigtramp_rt32 RELRO; | |
81 | # endif | |
82 | # ifdef HAVE_SIGTRAMP_32 | |
83 | PROCINFO_CLASS void *_dl_vdso_sigtramp_32 RELRO; | |
84 | # endif | |
85 | #endif | |
86 | ||
87 | #undef RELRO | |
88 | #undef PROCINFO_DECL | |
89 | #undef PROCINFO_CLASS |