2 * Copyright (C) 2006 CodeSourcery Inc
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
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.
10 #ifndef __SHARED_FLAT_LIB__
11 #define __SHARED_FLAT_LIB__
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);
32 extern struct shared_flat_lib *__first_shared_lib;
33 extern struct shared_flat_lib *__last_shared_lib;