summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-09-11 12:38:25 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:54 +0200
commit1a5caf2d9f6f7d42327a8e08c69cd27e96a0b8d5 (patch)
tree274b85536bb4b858b2dcfdc82283fa4e6e57393d /os_dep.c
parent0201a5b78617a8b2a8d18f55165868c4ee958eb2 (diff)
2010-09-11 Ivan Maidanski <ivmai@mail.ru>
* dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for FreeBSD). * dyn_load.c (GC_register_main_static_data): Move the definition above GC_register_dynamic_libraries_dl_iterate_phdr one (FreeBSD case); unconditionally return FALSE if DL_ITERATE_PHDR_STRONG. * dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr): Test GC_register_main_static_data() result (instead of direct testing of dl_iterate_phdr (to prevent a compiler warning). * os_dep.c (CODE_OK): Test si_code also for the value of 2 (FreeBSD case; required for FreeBSD v7+). * os_dep.c (CODE_OK): Properly use parentheses (HPUX case). * include/private/gcconfig.h (DATASTART): Cast etext argument in GC_FreeBSDGetDataStart() call; remove unnecessary "&" (FreeBSD case).
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/os_dep.c b/os_dep.c
index b5a3b36..eec623c 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -3013,7 +3013,8 @@ GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
# include <errno.h>
# if defined(FREEBSD)
# define SIG_OK TRUE
-# define CODE_OK (si -> si_code == BUS_PAGE_FAULT)
+# define CODE_OK (si -> si_code == BUS_PAGE_FAULT \
+ || si -> si_code == 2 /* experimentally determined */)
# elif defined(OSF1)
# define SIG_OK (sig == SIGSEGV)
# define CODE_OK (si -> si_code == 2 /* experimentally determined */)
@@ -3031,11 +3032,11 @@ GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
/* architectures. */
# elif defined(HPUX)
# define SIG_OK (sig == SIGSEGV || sig == SIGBUS)
-# define CODE_OK (si -> si_code == SEGV_ACCERR) \
- || (si -> si_code == BUS_ADRERR) \
- || (si -> si_code == BUS_UNKNOWN) \
- || (si -> si_code == SEGV_UNKNOWN) \
- || (si -> si_code == BUS_OBJERR)
+# define CODE_OK (si -> si_code == SEGV_ACCERR \
+ || si -> si_code == BUS_ADRERR \
+ || si -> si_code == BUS_UNKNOWN \
+ || si -> si_code == SEGV_UNKNOWN \
+ || si -> si_code == BUS_OBJERR)
# elif defined(SUNOS5SIGS)
# define SIG_OK (sig == SIGSEGV)
# define CODE_OK (si -> si_code == SEGV_ACCERR)