Re[2]: [Gc] GC_register_dynamic_libraries on FreeBSD

Ivan Maidanski ivmai at
Thu Feb 10 15:07:19 PST 2011

Hi Hans,

I've finally added caching for DATASTART/END (if they're defined as a call) but only in GC_register_map_entries, GC_register_dynamic_libraries_dl_iterate_phdr.

I have another question (regarding Darwin): _dyld_bind_fully_image_containing_address is deprecated (and, even more, iPhone/iPad don't have it at all) - is there a way to replace it with something? (As you're probably not a deep guru in Darwin, the question is really to the whole community.)

Changelog entries:
	* dyn_load.c (GC_register_map_entries,
	GC_register_dynamic_libraries_dl_iterate_phdr): Calculate
	* dyn_load.c (GC_register_dynamic_libraries_dl_iterate_phdr):
	Calculate DATAEND only once if DATAEND_IS_FUNC.
	* dyn_load.c: Add comment to some endif; realign some code.
	* dyn_load.c (GC_init_dyld): Don't use
	_dyld_bind_fully_image_containing_address if
	* include/private/gcconfig.h (GC_data_start, GC_find_limit):
	Declare if used by DATASTART/DATAEND, respectively.
	* include/private/gcconfig.h (DATASTART_IS_FUNC, DATAEND_IS_FUNC):
	Define if DATASTART/DATAEND is a function, respectively.
	* include/private/gcconfig.h (GETPAGESIZE, NO_PTHREAD_TRYLOCK,
	NO_DYLD_BIND_FULLY_IMAGE): Define for Darwin/arm as well; include


Thu, 27 Jan 2011 02:45:49 +0000 "Boehm, Hans" <hans.boehm at>:

> Sorry about the delay.
> No, I don't think that needs to be done repeatedly.  I initially thought it
> would be OK to just register the main data segment as permanent, non-temporary
> roots.  And that may be OK.  But I'm not sure we'll consistently take that
> code if we have an executable that initially links against no dynamic
> libraries, but then calls dlopen.  Is that even possible?  Maybe it's safer
> just to cache the values as you suggest and leave the rest of this alone.
> Hans
> From: gc-bounces at [mailto:gc-bounces at] On
> Behalf Of Ivan Maidanski
> Sent: Monday, January 17, 2011 1:47 PM
> To: gc at
> Subject: [Gc] GC_register_dynamic_libraries on FreeBSD
> Hi Hans,
> In dyn_load.c, we have GC_register_map_entries and
> GC_register_dynamic_libraries_dl_iterate_phdr() which could be called on each
> GC cycle, and these functions use DATASTART/END which are defined as
> GC_FreeBSDGetDataStart() or GC_find_limit() calls under FreeBSD on some
> architectures.
> The question is: should we really need to call GC_FreeBSDGetDataStart,
> GC_find_limit every GC? (If not, we could just call them once and cache the
> values.)
> Regards.
> _______________________________________________
> Gc mailing list
> Gc at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 19452 bytes
Desc: not available
Url :

More information about the Gc mailing list