void * getcpu_ifunc (void) { PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); return _dl_vdso_vsym ("__vdso_getcpu", &linux26); }
static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); __vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615); __vdso_clock_gettime = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2615); __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615); __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615); __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615); __vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615); /* PPC64 uses only one signal trampoline symbol, while PPC32 will use two depending if SA_SIGINFO is used (__kernel_sigtramp_rt32) or not (__kernel_sigtramp32). */ #if defined(__PPC64__) || defined(__powerpc64__) __vdso_sigtramp_rt64 = _dl_vdso_vsym ("__kernel_sigtramp_rt64", &linux2615); #else __vdso_sigtramp32 = _dl_vdso_vsym ("__kernel_sigtramp32", &linux2615); __vdso_sigtramp_rt32 = _dl_vdso_vsym ("__kernel_sigtramp_rt32", &linux2615); #endif }
void * time_ifunc (void) { PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); /* If the vDSO is not available we fall back on the old vsyscall. */ return _dl_vdso_vsym ("time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime; }
static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux2639, "LINUX_2.6.39", 123718537); __vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2639); __vdso_clock_gettime = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2639); __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2639); }
static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); void *p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26); PTR_MANGLE (p); __vdso_clock_gettime = p; }
void * time_ifunc (void) { PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); /* If the vDSO is not available we fall back to the syscall. */ void *vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615); return (vdso_time ? VDSO_IFUNC_RET (vdso_time) : (void*)time_syscall); }
void * gettimeofday_ifunc (void) { PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); /* If the vDSO is not available we fall back syscall. */ void *vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615); return (vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday) : (void*)__gettimeofday_syscall); }
static inline void _libc_vdso_platform_setup (void) { #ifdef __LP64__ PREPARE_VERSION (linux_version, "LINUX_2.6.39", 123718537); #else PREPARE_VERSION (linux_version, "LINUX_4.9", 61765625); #endif void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux_version); PTR_MANGLE (p); VDSO_SYMBOL(gettimeofday) = p; p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux_version); PTR_MANGLE (p); VDSO_SYMBOL(clock_gettime) = p; p = _dl_vdso_vsym ("__kernel_clock_getres", &linux_version); PTR_MANGLE (p); VDSO_SYMBOL(clock_getres) = p; }
static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); __vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615); __vdso_clock_gettime = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2615); __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615); __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615); __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615); }
static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); void *p = _dl_vdso_vsym ("gettimeofday", &linux26); /* If the vDSO is not available we fall back on the old vsyscall. */ #define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul if (p == NULL) p = (void *) VSYSCALL_ADDR_vgettimeofday; PTR_MANGLE (p); __vdso_gettimeofday = p; p = _dl_vdso_vsym ("clock_gettime", &linux26); PTR_MANGLE (p); __GI___vdso_clock_gettime = p; }
static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux2639, "LINUX_2.6.39", 123718537); void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2639); PTR_MANGLE (p); VDSO_SYMBOL(gettimeofday) = p; p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2639); PTR_MANGLE (p); VDSO_SYMBOL(clock_gettime) = p; p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2639); PTR_MANGLE (p); VDSO_SYMBOL(clock_getres) = p; }
static inline void _libc_vdso_platform_setup (void) { void *p; PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); /* It may happen that rtld didn't initialize the vDSO, so fallback to the syscall implementations if _dl_vdso_vsym returns NULL. This may happen when a static executable dlopen's a dynamic library. This really is nothing more than a workaround for rtld/csu deficiency. Ideally, init code would setup the vDSO for static binaries too. */ p = _dl_vdso_vsym ("__kernel_read_tp", &linux26); if (p != NULL) { __vdso_read_tp = p; __rtld___vdso_read_tp = p; } else assert (__vdso_read_tp == (void *) __vdso_read_tp_stub); p = _dl_vdso_vsym ("__kernel_atomic_cmpxchg_32", &linux26); if (p != NULL) { __vdso_atomic_cmpxchg_32 = p; __rtld___vdso_atomic_cmpxchg_32 = p; } else assert (__vdso_atomic_cmpxchg_32 == (void *) __vdso_atomic_cmpxchg_32_stub); p = _dl_vdso_vsym ("__kernel_atomic_barrier", &linux26); if (p != NULL) { __vdso_atomic_barrier = p; __rtld___vdso_atomic_barrier = p; } else assert (__vdso_atomic_barrier == (void *) __vdso_atomic_barrier_stub); }
static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); __vdso_gettimeofday = _dl_vdso_vsym ("__vdso_gettimeofday", &linux26); }