shared_flat_lib.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. struct shared_flat_lib {
  13. struct shared_flat_lib *prev;
  14. struct shared_flat_lib *next;
  15. /* .preinit_array is usually only supported for executables.
  16. * However, the distinction between the executable and its
  17. * shared libraries isn't as pronounced for flat files; a shared
  18. * library is really just a part of an executable that can be
  19. * shared with other executables. We therefore allow
  20. * .preinit_array to be used in libraries too. */
  21. void (**preinit_array_start)(void);
  22. void (**preinit_array_end)(void);
  23. void (**init_array_start)(void);
  24. void (**init_array_end)(void);
  25. void (**fini_array_start)(void);
  26. void (**fini_array_end)(void);
  27. void (*init)(void);
  28. void (*fini)(void);
  29. };
  30. extern struct shared_flat_lib *__first_shared_lib;
  31. extern struct shared_flat_lib *__last_shared_lib;
  32. #endif