summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-06-01 12:21:09 +0200
committerIvan Maidanski <ivmai@mail.ru>2013-06-01 12:21:09 +0200
commitb4c520670773821d764348f6f3d0247ae27a8afc (patch)
tree8af7c12c4a1215ae3b2609574356496c7bf40d79
parent14a5128999f6590969741e7e74a2eee4157ab0ad (diff)
Fix GC_INIT_CONF_ROOTS in gc.h for Android (define __data_start as weak)
* include/gc.h (GC_INIT_CONF_ROOTS): Define __data_start as weak symbol for Android (including x86 and MIPS targets); do not call GC_add_roots if __data_start symbol is unresolved.
-rw-r--r--include/gc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/gc.h b/include/gc.h
index fe04fbc..5db4040 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -1606,10 +1606,12 @@ GC_API int GC_CALL GC_get_force_unmap_on_gcollect(void);
# define GC_DATAEND ((void *)((ulong)_end))
# define GC_INIT_CONF_ROOTS GC_add_roots(GC_DATASTART, GC_DATAEND)
#elif (defined(PLATFORM_ANDROID) || defined(__ANDROID__)) \
- && defined(__arm__) && !defined(GC_NOT_DLL)
+ && !defined(GC_NOT_DLL)
/* Required if GC is built as shared lib with -D IGNORE_DYNAMIC_LOADING. */
+# pragma weak __data_start
extern int __data_start[], _end[];
-# define GC_INIT_CONF_ROOTS GC_add_roots(__data_start, _end)
+# define GC_INIT_CONF_ROOTS (void)((GC_word)(__data_start) != 0 ? \
+ (GC_add_roots(__data_start, _end), 0) : 0)
#else
# define GC_INIT_CONF_ROOTS /* empty */
#endif