|
Packit Service |
200f70 |
/* Invoke the early initialization function in libc.so.
|
|
Packit Service |
200f70 |
Copyright (C) 2020 Free Software Foundation, Inc.
|
|
Packit Service |
200f70 |
This file is part of the GNU C Library.
|
|
Packit Service |
200f70 |
|
|
Packit Service |
200f70 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
200f70 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
200f70 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
200f70 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
200f70 |
|
|
Packit Service |
200f70 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
200f70 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
200f70 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
200f70 |
Lesser General Public License for more details.
|
|
Packit Service |
200f70 |
|
|
Packit Service |
200f70 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
200f70 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
200f70 |
<https://www.gnu.org/licenses/>. */
|
|
Packit Service |
200f70 |
|
|
Packit Service |
200f70 |
#include <assert.h>
|
|
Packit Service |
200f70 |
#include <ldsodefs.h>
|
|
Packit Service |
200f70 |
#include <libc-early-init.h>
|
|
Packit Service |
200f70 |
#include <link.h>
|
|
Packit Service |
200f70 |
#include <stddef.h>
|
|
Packit Service |
200f70 |
|
|
Packit Service |
200f70 |
void
|
|
Packit Service |
0a5f20 |
_dl_call_libc_early_init (struct link_map *libc_map, _Bool initial)
|
|
Packit Service |
200f70 |
{
|
|
Packit Service |
200f70 |
/* There is nothing to do if we did not actually load libc.so. */
|
|
Packit Service |
200f70 |
if (libc_map == NULL)
|
|
Packit Service |
200f70 |
return;
|
|
Packit Service |
200f70 |
|
|
Packit Service |
200f70 |
const ElfW(Sym) *sym
|
|
Packit Service |
200f70 |
= _dl_lookup_direct (libc_map, "__libc_early_init",
|
|
Packit Service |
200f70 |
0x069682ac, /* dl_new_hash output. */
|
|
Packit Service |
200f70 |
"GLIBC_PRIVATE",
|
|
Packit Service |
200f70 |
0x0963cf85); /* _dl_elf_hash output. */
|
|
Packit Service |
200f70 |
assert (sym != NULL);
|
|
Packit Service |
200f70 |
__typeof (__libc_early_init) *early_init
|
|
Packit Service |
200f70 |
= DL_SYMBOL_ADDRESS (libc_map, sym);
|
|
Packit Service |
0a5f20 |
early_init (initial);
|
|
Packit Service |
200f70 |
}
|