aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-08-13 00:23:59 +0000
committerUlrich Drepper <drepper@redhat.com>2007-08-13 00:23:59 +0000
commit3c87d79db7ae1f65294d088be7709140780b652c (patch)
tree603151b0786c63510e4e3f85bb019bb7da9aa312
parent974a1f0fb2fa441152dfda9acb4c3898f67eea6a (diff)
downloadglibc-3c87d79db7ae1f65294d088be7709140780b652c.zip
glibc-3c87d79db7ae1f65294d088be7709140780b652c.tar.gz
glibc-3c87d79db7ae1f65294d088be7709140780b652c.tar.bz2
* 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.
-rw-r--r--ChangeLog12
-rw-r--r--elf/cache.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/libc-start.c8
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h12
4 files changed, 27 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8688186..55201ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-08-12 Ulrich Drepper <drepper@redhat.com>
+
+ * 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.
+
2007-08-01 Andreas Jaeger <aj@suse.de>
Jakub Jelinek <jakub@redhat.com>
diff --git a/elf/cache.c b/elf/cache.c
index 180adea..9a600ea 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -547,7 +547,7 @@ struct aux_cache_file
/* After this the string table of size len_strings is found. */
};
-static unsigned int primes[] =
+static const unsigned int primes[] =
{
1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139,
524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393,
diff --git a/sysdeps/unix/sysv/linux/x86_64/libc-start.c b/sysdeps/unix/sysv/linux/x86_64/libc-start.c
index 08b1c49..0ce4795 100644
--- a/sysdeps/unix/sysv/linux/x86_64/libc-start.c
+++ b/sysdeps/unix/sysv/linux/x86_64/libc-start.c
@@ -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
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 61701a2..44d5650 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -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; \