1 /* Copyright (C) 2010 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
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.
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.
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 <http://www.gnu.org/licenses/>. */
19 /* Note: linking in vDSO to a static binary requires changes to
20 the main GLIBC proper. Not yet implemented. */
24 #include <bits/m68k-vdso.h>
27 _libc_vdso_platform_setup (void)
31 PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
33 /* It may happen that rtld didn't initialize the vDSO, so fallback
34 to the syscall implementations if _dl_vdso_vsym returns NULL.
35 This may happen when a static executable dlopen's a dynamic library.
36 This really is nothing more than a workaround for rtld/csu
37 deficiency. Ideally, init code would setup the vDSO for static
40 p = _dl_vdso_vsym ("__kernel_read_tp", &linux26);
44 __rtld___vdso_read_tp = p;
47 assert (__vdso_read_tp == (void *) __vdso_read_tp_stub);
49 p = _dl_vdso_vsym ("__kernel_atomic_cmpxchg_32", &linux26);
52 __vdso_atomic_cmpxchg_32 = p;
53 __rtld___vdso_atomic_cmpxchg_32 = p;
56 assert (__vdso_atomic_cmpxchg_32
57 == (void *) __vdso_atomic_cmpxchg_32_stub);
59 p = _dl_vdso_vsym ("__kernel_atomic_barrier", &linux26);
62 __vdso_atomic_barrier = p;
63 __rtld___vdso_atomic_barrier = p;
66 assert (__vdso_atomic_barrier == (void *) __vdso_atomic_barrier_stub);
69 #define VDSO_SETUP _libc_vdso_platform_setup
73 #include <sysdeps/unix/sysv/linux/init-first.c>