]> git.ipfire.org Git - thirdparty/glibc.git/blame - ports/sysdeps/unix/sysv/linux/m68k/init-first.c
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / ports / sysdeps / unix / sysv / linux / m68k / init-first.c
CommitLineData
93c65d43 1/* Initialization code run first thing by the ELF startup code. Linux/m68k.
d4697bc9 2 Copyright (C) 2010-2014 Free Software Foundation, Inc.
40111cb9
MK
3 This file is part of the GNU C Library.
4 Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
ab84e3ff
PE
17 License along with the GNU C Library. If not, see
18 <http://www.gnu.org/licenses/>. */
40111cb9
MK
19
20/* Note: linking in vDSO to a static binary requires changes to
21 the main GLIBC proper. Not yet implemented. */
22#ifdef SHARED
23
24#include <dl-vdso.h>
25#include <bits/m68k-vdso.h>
26
27static inline void
28_libc_vdso_platform_setup (void)
29{
30 void *p;
31
32 PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
33
34 /* It may happen that rtld didn't initialize the vDSO, so fallback
35 to the syscall implementations if _dl_vdso_vsym returns NULL.
36 This may happen when a static executable dlopen's a dynamic library.
37 This really is nothing more than a workaround for rtld/csu
38 deficiency. Ideally, init code would setup the vDSO for static
39 binaries too. */
40
41 p = _dl_vdso_vsym ("__kernel_read_tp", &linux26);
42 if (p != NULL)
43 {
44 __vdso_read_tp = p;
45 __rtld___vdso_read_tp = p;
46 }
47 else
48 assert (__vdso_read_tp == (void *) __vdso_read_tp_stub);
49
50 p = _dl_vdso_vsym ("__kernel_atomic_cmpxchg_32", &linux26);
51 if (p != NULL)
52 {
53 __vdso_atomic_cmpxchg_32 = p;
54 __rtld___vdso_atomic_cmpxchg_32 = p;
55 }
56 else
57 assert (__vdso_atomic_cmpxchg_32
58 == (void *) __vdso_atomic_cmpxchg_32_stub);
59
60 p = _dl_vdso_vsym ("__kernel_atomic_barrier", &linux26);
61 if (p != NULL)
62 {
63 __vdso_atomic_barrier = p;
64 __rtld___vdso_atomic_barrier = p;
65 }
66 else
67 assert (__vdso_atomic_barrier == (void *) __vdso_atomic_barrier_stub);
68}
69
70#define VDSO_SETUP _libc_vdso_platform_setup
71
72#endif /* SHARED */
73
93c65d43 74#include <csu/init-first.c>