summaryrefslogtreecommitdiff
path: root/dyn_load.c
diff options
context:
space:
mode:
authorivmai <ivmai>2009-10-20 23:27:25 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:51 +0200
commitc4e4721f491632c2039cece14400f353794273f4 (patch)
tree81ea0ea761bfcdc92d55a67d28fc0f83659cf9dd /dyn_load.c
parentf2127b50f72ad5449c24f1e0bd4b3d4ca88185d8 (diff)
2009-10-20 Ivan Maidanski <ivmai@mail.ru> (really mostly OpenBSD contributors)
* configure.ac (openbsd): Define GC_OPENBSD_THREADS. * configure.ac: Add AM_CONDITIONAL(OPENBSD_THREADS). * configure.ac: Add sparc-openbsd case. * doc/README.macros (GC_NETBSD_THREADS, GC_OPENBSD_THREADS): Document. * tests/test.c (main): Handle OpenBSD case. * extra/threadlibs.c: Add the copyright header; expand all tabs to spaces; remove trailing spaces at EOLn. * include/private/pthread_stop_world.h: Ditto. * extra/threadlibs.c (main): Replace K&R-style function definition with the ANSI C one. * extra/threadlibs.c (main): Handle GC_OPENBSD_THREADS case. * dyn_load.c (OPENBSD): Recognize (similar to NETBSD). * include/gc_config_macros.h (GC_SOLARIS_THREADS): Recognize; define it for OpenBSD. * include/gc_pthread_redirects.h (GC_pthread_sigmask, pthread_sigmask): Don't declare and redefine for OpenBSD. * include/private/gcconfig.h: Handle OpenBSD (on arm, sh, i386, amd64, powerpc). * mach_dep.c (NO_GETCONTEXT): Ditto. * include/private/pthread_stop_world.h (thread_stop_info): Don't define last_stop_count field if OpenBSD. * misc.c (GC_init_dyld): Add declaration (if NetBSD). * misc.c (GC_init): Don't call GC_init_netbsd_elf() for OpenBSD. * os_dep.c (GC_init_netbsd_elf): Don't define for OpenBSD. * os_dep.c (old_segv_act, GC_jmp_buf_openbsd): New static variable (only if OpenBSD). * os_dep.c (GC_fault_handler_openbsd, GC_find_limit_openbsd, GC_skip_hole_openbsd): New static function (only if OpenBSD). * os_dep.c (GC_get_stack_base, GC_get_main_stack_base, GC_register_data_segments): Define specially for OpenBSD case. * os_dep.c (GC_fault_handler_lock): Initialize to AO_TS_INITIALIZER (instead of 0). * pthread_support.c (GC_allocate_lock): Ditto. * pthread_stop_world.c (NSIG, GC_print_sig_mask, GC_remove_allowed_signals, suspend_handler_mask, GC_stop_count, GC_world_is_stopped, GC_retry_signals, SIG_THR_RESTART, GC_suspend_ack_sem, GC_suspend_handler_inner, GC_suspend_handler, GC_restart_handler): Don't define and use if OpenBSD. * pthread_stop_world.c (GC_suspend_all, GC_stop_world, GC_start_world): Handle OpenBSD case. * pthread_stop_world.c (GC_stop_init): Define as empty if OpenBSD. * pthread_support.c (pthread_sigmask): Don't undefine the macro and don't define the wrapper function if OpenBSD. * pthread_support.c (GC_thr_init): Handle OpenBSD case. * configure: Regenerate. * include/private/config.h.in: Ditto.
Diffstat (limited to 'dyn_load.c')
-rw-r--r--dyn_load.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/dyn_load.c b/dyn_load.c
index 7cf9296..49e8a35 100644
--- a/dyn_load.c
+++ b/dyn_load.c
@@ -67,6 +67,7 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
!defined(HPUX) && !(defined(LINUX) && defined(__ELF__)) && \
!defined(AIX) && !defined(SCO_ELF) && !defined(DGUX) && \
!(defined(FREEBSD) && defined(__ELF__)) && \
+ !(defined(OPENBSD) && (defined(__ELF__) || defined(M68K))) && \
!(defined(NETBSD) && defined(__ELF__)) && !defined(HURD) && \
!defined(DARWIN) && !defined(CYGWIN32)
--> We only know how to find data segments of dynamic libraries for the
@@ -86,12 +87,15 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
# define ELFSIZE ARCH_ELFSIZE
#endif
-#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
- (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
-# include <stddef.h>
+#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \
+ || (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
+ || defined(NETBSD) || defined(OPENBSD)))
+# include <stddef.h>
+# if !defined(OPENBSD)
+ /* FIXME: Why we exclude it for OpenBSD? */
# include <elf.h>
-# include <link.h>
+# endif
+# include <link.h>
#endif
/* Newer versions of GNU/Linux define this macro. We
@@ -103,7 +107,7 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
# else
# define ElfW(type) Elf64_##type
# endif
-# elif defined(NETBSD)
+# elif defined(NETBSD) || defined(OPENBSD)
# if ELFSIZE == 32
# define ElfW(type) Elf32_##type
# else
@@ -218,10 +222,9 @@ void GC_register_dynamic_libraries(void)
# endif /* !USE_PROC ... */
# endif /* SOLARISDL */
-#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
- (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
- (defined(NETBSD) && defined(__ELF__)) || defined(HURD)
-
+#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \
+ || (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
+ || defined(NETBSD) || defined(OPENBSD)))
#ifdef USE_PROC_FOR_LIBRARIES
@@ -562,7 +565,7 @@ GC_bool GC_register_main_static_data(void)
/* This doesn't necessarily work in all cases, e.g. with preloaded
* dynamic libraries. */
-#if defined(NETBSD)
+#if defined(NETBSD) || defined(OPENBSD)
# include <sys/exec_elf.h>
/* for compatibility with 1.4.x */
# ifndef DT_DEBUG