OSDN Git Service

Richard Sandiford writes: add support for init/fini arrays in shared flat libraries
[uclinux-h8/uClibc.git] / libc / misc / internals / shared_flat_lib.h
1 /*
2  * Copyright (C) 2006 CodeSourcery Inc
3  *
4  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
5  *
6  * This file defines the shared_flat_lib structure and the global library
7  * list.   The structure is used to provide something close to ELF-like
8  * initialisation and finalisation when using shared flat libraries.
9  */
10 #ifndef __SHARED_FLAT_LIB__
11 #define __SHARED_FLAT_LIB__
12
13 struct shared_flat_lib {
14         struct shared_flat_lib *prev;
15         struct shared_flat_lib *next;
16         /* .preinit_array is usually only supported for executables.
17          * However, the distinction between the executable and its
18          * shared libraries isn't as pronounced for flat files; a shared
19          * library is really just a part of an executable that can be
20          * shared with other executables.  We therefore allow
21          * .preinit_array to be used in libraries too.  */
22         void (**preinit_array_start)(void);
23         void (**preinit_array_end)(void);
24         void (**init_array_start)(void);
25         void (**init_array_end)(void);
26         void (**fini_array_start)(void);
27         void (**fini_array_end)(void);
28         void (*init)(void);
29         void (*fini)(void);
30 };
31
32 extern struct shared_flat_lib *__first_shared_lib;
33 extern struct shared_flat_lib *__last_shared_lib;
34
35 #endif