2009-03-04 04:28:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2008 The Android Open Source Project
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
2018-02-13 23:26:29 +01:00
|
|
|
|
|
|
|
#pragma once
|
2009-03-04 04:28:35 +01:00
|
|
|
|
2020-12-15 22:55:32 +01:00
|
|
|
#include <stdint.h>
|
2013-02-07 19:14:39 +01:00
|
|
|
#include <sys/cdefs.h>
|
2009-03-04 04:28:35 +01:00
|
|
|
|
2020-10-23 18:55:33 +02:00
|
|
|
typedef void init_func_t(int, char*[], char*[]);
|
|
|
|
typedef void fini_func_t(void);
|
|
|
|
|
2013-02-07 19:14:39 +01:00
|
|
|
typedef struct {
|
2020-10-23 18:55:33 +02:00
|
|
|
init_func_t** preinit_array;
|
|
|
|
init_func_t** init_array;
|
|
|
|
fini_func_t** fini_array;
|
2009-03-04 04:28:35 +01:00
|
|
|
} structors_array_t;
|
|
|
|
|
2013-02-07 19:14:39 +01:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
extern int main(int argc, char** argv, char** env);
|
|
|
|
|
|
|
|
__noreturn void __libc_init(void* raw_args,
|
|
|
|
void (*onexit)(void),
|
|
|
|
int (*slingshot)(int, char**, char**),
|
2014-06-05 01:29:37 +02:00
|
|
|
structors_array_t const* const structors);
|
|
|
|
__LIBC_HIDDEN__ void __libc_fini(void* finit_array);
|
2013-02-07 19:14:39 +01:00
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
2015-06-09 03:04:00 +02:00
|
|
|
|
2018-11-22 12:16:06 +01:00
|
|
|
__LIBC_HIDDEN__ void __libc_init_globals();
|
2015-10-06 20:08:13 +02:00
|
|
|
|
2018-11-22 11:41:36 +01:00
|
|
|
__LIBC_HIDDEN__ void __libc_init_common();
|
2015-06-09 03:04:00 +02:00
|
|
|
|
2020-12-15 22:55:32 +01:00
|
|
|
__LIBC_HIDDEN__ void __libc_init_scudo();
|
|
|
|
|
2022-05-12 22:06:04 +02:00
|
|
|
__LIBC_HIDDEN__ void __libc_init_mte_late();
|
|
|
|
|
2018-11-22 11:41:36 +01:00
|
|
|
__LIBC_HIDDEN__ void __libc_init_AT_SECURE(char** envp);
|
2015-06-09 03:04:00 +02:00
|
|
|
|
2019-11-15 01:02:09 +01:00
|
|
|
// The fork handler must be initialised after __libc_init_malloc, as
|
|
|
|
// pthread_atfork may call malloc() during its once-init.
|
|
|
|
__LIBC_HIDDEN__ void __libc_init_fork_handler();
|
|
|
|
|
2021-03-05 22:31:41 +01:00
|
|
|
__LIBC_HIDDEN__ void __libc_set_target_sdk_version(int target);
|
|
|
|
|
2013-02-07 19:14:39 +01:00
|
|
|
#endif
|