mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
* sysdeps/unix/sysv/linux/x86_64/libc-start.c
(_libc_vdso_platform_setup): Mangle function pointers before storing them. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (INLINE_VSYSCALL): Demangle vdso pointer before use. (INTERNAL_VSYSCALL): Likewise. * elf/cache.c (primes): Mark as const. Noted by Roland McGrath.
This commit is contained in:
@ -30,9 +30,13 @@ _libc_vdso_platform_setup (void)
|
||||
{
|
||||
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
|
||||
|
||||
__vdso_gettimeofday = _dl_vdso_vsym ("gettimeofday", &linux26);
|
||||
void *p = _dl_vdso_vsym ("gettimeofday", &linux26);
|
||||
PTR_MANGLE (p);
|
||||
__vdso_gettimeofday = p;
|
||||
|
||||
__vdso_clock_gettime = _dl_vdso_vsym ("clock_gettime", &linux26);
|
||||
p = _dl_vdso_vsym ("clock_gettime", &linux26);
|
||||
PTR_MANGLE (p);
|
||||
__vdso_clock_gettime = p;
|
||||
}
|
||||
|
||||
# define VDSO_SETUP _libc_vdso_platform_setup
|
||||
|
@ -264,9 +264,11 @@
|
||||
INTERNAL_SYSCALL_DECL (sc_err); \
|
||||
long int sc_ret; \
|
||||
\
|
||||
if (__vdso_##name != NULL) \
|
||||
__typeof (__vdso_##name) vdsop = __vdso_##name; \
|
||||
PTR_DEMANGLE (vdsop); \
|
||||
if (vdsop != NULL) \
|
||||
{ \
|
||||
sc_ret = __vdso_##name (args); \
|
||||
sc_ret = vdsop (args); \
|
||||
if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \
|
||||
goto out; \
|
||||
if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS) \
|
||||
@ -288,9 +290,11 @@
|
||||
__label__ out; \
|
||||
long int v_ret; \
|
||||
\
|
||||
if (__vdso_##name != NULL) \
|
||||
__typeof (__vdso_##name) vdsop = __vdso_##name; \
|
||||
PTR_DEMANGLE (vdsop); \
|
||||
if (vdsop != NULL) \
|
||||
{ \
|
||||
v_ret = __vdso_##name (args); \
|
||||
v_ret = vdsop (args); \
|
||||
if (!INTERNAL_SYSCALL_ERROR_P (v_ret, err) \
|
||||
|| INTERNAL_SYSCALL_ERRNO (v_ret, err) != ENOSYS) \
|
||||
goto out; \
|
||||
|
Reference in New Issue
Block a user