diff options
author | Tsugutomo Enami <tsugutomo.enami@jp.sony.com> | 2012-06-01 03:12:24 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-06-01 03:16:34 +0400 |
commit | 48e412935fe5e7d610f55a80e0902300feff3b1d (patch) | |
tree | de03045e6d168b60bfadbaabb7ff5ce06fc11b31 /dyn_load.c | |
parent | 75281019c6e3eb0e9e28cc2e37ab307272f43508 (diff) | |
download | bdwgc-48e412935fe5e7d610f55a80e0902300feff3b1d.tar.gz |
Fix GC_FirstDLOpenedLinkMap() for FreeBSD 9 release
* dyn_load.c: Include sys/param.h and dlfcn.h on FreeBSD.
* dyn_load.c (GC_FirstDLOpenedLinkMap): Obtain link map using dlinfo()
on FreeBSD if RTLD_DI_LINKMAP feature present (defined).
Diffstat (limited to 'dyn_load.c')
-rw-r--r-- | dyn_load.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -74,6 +74,8 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0; #endif #if defined(NETBSD) +# include <sys/param.h> +# include <dlfcn.h> # include <machine/elf_machdep.h> # define ELFSIZE ARCH_ELFSIZE #endif @@ -642,6 +644,11 @@ GC_FirstDLOpenedLinkMap(void) return(0); } if( cachedResult == 0 ) { +# if defined(NETBSD) && defined(RTLD_DI_LINKMAP) + struct link_map *lm = NULL; + if (!dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &lm)) + cachedResult = lm; +# else int tag; for( dp = _DYNAMIC; (tag = dp->d_tag) != 0; dp++ ) { if( tag == DT_DEBUG ) { @@ -651,6 +658,7 @@ GC_FirstDLOpenedLinkMap(void) break; } } +# endif /* !NETBSD || !RTLD_DI_LINKMAP */ } return cachedResult; } |