summaryrefslogtreecommitdiff
path: root/dyn_load.c
diff options
context:
space:
mode:
authorivmai <ivmai>2009-12-08 18:08:14 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:52 +0200
commitcbad004e789aca685678076e721183f25b2dde9d (patch)
tree5e79105716924417d00c97c2f19c649130bfd45d /dyn_load.c
parent61d0de0517da47be2718db10e7987f6ab4936bd6 (diff)
2009-12-08 Ivan Maidanski <ivmai@mail.ru> (with input from Marcos Dione)
* doc/README.macros (IGNORE_DYNAMIC_LOADING, PLATFORM_ANDROID): Document. * dyn_load.c: Don't include <elf.h> if PLATFORM_ANDROID. * dyn_load.c: Include bionic <linker.h> (instead of <link.h>) if PLATFORM_ANDROID. * include/private/gcconfig.h (LINUX): Define also if PLATFORM_ANDROID (for the windows-based toolkit). * include/private/gcconfig.h (SEARCH_FOR_DATA_START): Explicitly define for Android/x86 platform. * include/private/gcconfig.h (IGNORE_DYNAMIC_LOADING): Recognize new macro (undefine DYNAMIC_LOADING in this case). * include/private/gcconfig.h (CANCEL_SAFE): Don't define if PLATFORM_ANDROID. * include/private/gcconfig.h (IF_CANCEL): Fix definition for the explicitly defined CANCEL_SAFE.
Diffstat (limited to 'dyn_load.c')
-rw-r--r--dyn_load.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/dyn_load.c b/dyn_load.c
index 3d22d64..d9799db 100644
--- a/dyn_load.c
+++ b/dyn_load.c
@@ -85,11 +85,19 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
|| (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
|| defined(NETBSD) || defined(OPENBSD)))
# include <stddef.h>
-# if !defined(OPENBSD)
+# if !defined(OPENBSD) && !defined(PLATFORM_ANDROID)
/* FIXME: Why we exclude it for OpenBSD? */
+ /* Exclude Android because linker.h below includes its own version. */
# include <elf.h>
# endif
-# include <link.h>
+# ifdef PLATFORM_ANDROID
+ /* The header file is in bionics/linker. */
+ /* If you don't need the "dynamic loading" feature, you may build */
+ /* the collector with -D IGNORE_DYNAMIC_LOADING. */
+# include <linker.h>
+# else
+# include <link.h>
+# endif
#endif
/* Newer versions of GNU/Linux define this macro. We
@@ -571,10 +579,13 @@ GC_INNER GC_bool GC_register_main_static_data(void)
# ifndef PF_W
# define PF_W 2
# endif
-#else
+#elif !defined(PLATFORM_ANDROID)
# include <elf.h>
#endif
-#include <link.h>
+
+#ifndef PLATFORM_ANDROID
+# include <link.h>
+#endif
# endif