Linux: consolidate link implementation
[glibc.git] / elf / libc-early-init.h
bloba8edfadfb0bd0546b8a2680afea898b4eeca1547
1 /* Early initialization of libc.so.
2 Copyright (C) 2020-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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 <https://www.gnu.org/licenses/>. */
19 #ifndef _LIBC_EARLY_INIT_H
20 #define _LIBC_EARLY_INIT_H
22 struct link_map;
24 /* If LIBC_MAP is not NULL, look up the __libc_early_init symbol in it
25 and call this function, with INITIAL as the argument. */
26 void _dl_call_libc_early_init (struct link_map *libc_map, _Bool initial)
27 attribute_hidden;
29 /* In the shared case, this function is defined in libc.so and invoked
30 from ld.so (or on the fist static dlopen) after complete relocation
31 of a new loaded libc.so, but before user-defined ELF constructors
32 run. In the static case, this function is called directly from the
33 startup code. If INITIAL is true, the libc being initialized is
34 the libc for the main program. INITIAL is false for libcs loaded
35 for audit modules, dlmopen, and static dlopen. */
36 void __libc_early_init (_Bool initial);
38 #endif /* _LIBC_EARLY_INIT_H */