summaryrefslogtreecommitdiff
path: root/libc/misc/internals/shared_flat_lib.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-12-08 22:53:40 +0000
committerMike Frysinger <vapier@gentoo.org>2006-12-08 22:53:40 +0000
commit808694e8a330e32741b7781467610d8cec99ae6e (patch)
treea2114e7c67f1f88f5df4687d6ab7122892e68283 /libc/misc/internals/shared_flat_lib.h
parentcba2c53724a6ed35f32775ec38906268c1bbd340 (diff)
Richard Sandiford writes: add support for init/fini arrays in shared flat libraries
Diffstat (limited to 'libc/misc/internals/shared_flat_lib.h')
-rw-r--r--libc/misc/internals/shared_flat_lib.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/libc/misc/internals/shared_flat_lib.h b/libc/misc/internals/shared_flat_lib.h
new file mode 100644
index 000000000..e01213564
--- /dev/null
+++ b/libc/misc/internals/shared_flat_lib.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2006 CodeSourcery Inc
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ * This file defines the shared_flat_lib structure and the global library
+ * list. The structure is used to provide something close to ELF-like
+ * initialisation and finalisation when using shared flat libraries.
+ */
+#ifndef __SHARED_FLAT_LIB__
+#define __SHARED_FLAT_LIB__
+
+struct shared_flat_lib {
+ struct shared_flat_lib *prev;
+ struct shared_flat_lib *next;
+ /* .preinit_array is usually only supported for executables.
+ * However, the distinction between the executable and its
+ * shared libraries isn't as pronounced for flat files; a shared
+ * library is really just a part of an executable that can be
+ * shared with other executables. We therefore allow
+ * .preinit_array to be used in libraries too. */
+ void (**preinit_array_start)(void);
+ void (**preinit_array_end)(void);
+ void (**init_array_start)(void);
+ void (**init_array_end)(void);
+ void (**fini_array_start)(void);
+ void (**fini_array_end)(void);
+ void (*init)(void);
+ void (*fini)(void);
+};
+
+extern struct shared_flat_lib *__first_shared_lib;
+extern struct shared_flat_lib *__last_shared_lib;
+
+#endif