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