|
Packit |
6c4009 |
/* Initialization code run first thing by the ELF startup code. Linux/m68k.
|
|
Packit |
6c4009 |
Copyright (C) 2010-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library. If not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Note: linking in vDSO to a static binary requires changes to
|
|
Packit |
6c4009 |
the main GLIBC proper. Not yet implemented. */
|
|
Packit |
6c4009 |
#ifdef SHARED
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <dl-vdso.h>
|
|
Packit |
6c4009 |
#include <m68k-vdso.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
static inline void
|
|
Packit |
6c4009 |
_libc_vdso_platform_setup (void)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
void *p;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* It may happen that rtld didn't initialize the vDSO, so fallback
|
|
Packit |
6c4009 |
to the syscall implementations if _dl_vdso_vsym returns NULL.
|
|
Packit |
6c4009 |
This may happen when a static executable dlopen's a dynamic library.
|
|
Packit |
6c4009 |
This really is nothing more than a workaround for rtld/csu
|
|
Packit |
6c4009 |
deficiency. Ideally, init code would setup the vDSO for static
|
|
Packit |
6c4009 |
binaries too. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
p = _dl_vdso_vsym ("__kernel_read_tp", &linux26);
|
|
Packit |
6c4009 |
if (p != NULL)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
__vdso_read_tp = p;
|
|
Packit |
6c4009 |
__rtld___vdso_read_tp = p;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
assert (__vdso_read_tp == (void *) __vdso_read_tp_stub);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
p = _dl_vdso_vsym ("__kernel_atomic_cmpxchg_32", &linux26);
|
|
Packit |
6c4009 |
if (p != NULL)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
__vdso_atomic_cmpxchg_32 = p;
|
|
Packit |
6c4009 |
__rtld___vdso_atomic_cmpxchg_32 = p;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
assert (__vdso_atomic_cmpxchg_32
|
|
Packit |
6c4009 |
== (void *) __vdso_atomic_cmpxchg_32_stub);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
p = _dl_vdso_vsym ("__kernel_atomic_barrier", &linux26);
|
|
Packit |
6c4009 |
if (p != NULL)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
__vdso_atomic_barrier = p;
|
|
Packit |
6c4009 |
__rtld___vdso_atomic_barrier = p;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
assert (__vdso_atomic_barrier == (void *) __vdso_atomic_barrier_stub);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define VDSO_SETUP _libc_vdso_platform_setup
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* SHARED */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <csu/init-first.c>
|