diff options
author | andreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-08 19:23:58 +0000 |
---|---|---|
committer | andreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-08 19:23:58 +0000 |
commit | 928973dc31278c043d932603079de56f5b40619a (patch) | |
tree | d401774a93a831901d00b5fb20b5620d25dfe2b5 /libjava/darwin.cc | |
parent | d459bc2027db75e5c8ed367994903420acacd2ad (diff) | |
download | gcc-928973dc31278c043d932603079de56f5b40619a.tar.gz |
2007-12-08 Andreas Tobler <a.tobler@schweiz.org>
* configure.host: Add bits for i?86-*-darwin9 and x86_64-*-darwin9.
* configure.ac: Add darwin-signal.h to x86_64-*-darwin9 and
i?86-*darwin9.
* configure.in: Regenerate.
* darwin.cc: Add definitions for Darwin specific functions for 64-bit.
(darwin_java_register_dyld_add_image_hook): Use this specific
functions.
* Makefile.am (gij_LDFLAGS): Add extra_gij_ldflags for Darwin9.
* Makefile.in: Regenerate.
* include/Makefile.in: Likewise.
* gcj/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.
* testsuite/lib/libjava.exp (libjava_arguments): Add allow_stack_execute
for *-*-darwin9*.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130709 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/darwin.cc')
-rw-r--r-- | libjava/darwin.cc | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/libjava/darwin.cc b/libjava/darwin.cc index d427ba7cd19..f6406b37599 100644 --- a/libjava/darwin.cc +++ b/libjava/darwin.cc @@ -1,6 +1,6 @@ /* darwin.cc - class loader stuff for Darwin. */ -/* Copyright (C) 2004 Free Software Foundation +/* Copyright (C) 2004, 2007 Free Software Foundation This file is part of libgcj. @@ -21,26 +21,43 @@ details. */ ourself. */ #include <stdint.h> -struct mach_header; -extern "C" void _dyld_register_func_for_add_image - (void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide)); -extern "C" void _dyld_register_func_for_remove_image - (void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide)); -extern "C" char *getsectdatafromheader -(const struct mach_header *mhp, const char *segname, const char *sectname, - uint32_t *size); +#if !defined (__LP64__) + struct mach_header; +# define JAVA_MACH_HEADER mach_header +# define mh_size_t uint32_t + extern "C" void _dyld_register_func_for_add_image + (void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide)); + extern "C" void _dyld_register_func_for_remove_image + (void (*func)(const struct mach_header *mh, intptr_t vmaddr_slide)); + extern "C" char *getsectdatafromheader + (const struct mach_header *mhp, const char *segname, const char *sectname, + uint32_t *size); +# define GETSECTDATA getsectdatafromheader +#else + struct mach_header_64; +# define JAVA_MACH_HEADER mach_header_64 +# define mh_size_t uint64_t + extern "C" void _dyld_register_func_for_add_image + (void (*func)(const struct mach_header_64 *mh, intptr_t vmaddr_slide)); + extern "C" void _dyld_register_func_for_remove_image + (void (*func)(const struct mach_header_64 *mh, intptr_t vmaddr_slide)); + extern "C" char *getsectdatafromheader_64 + (const struct mach_header_64 *mhp, const char *segname, + const char *sectname, uint64_t *size); +# define GETSECTDATA getsectdatafromheader_64 +#endif /* When a new image is loaded, look to see if it has a jcr section and if so register the classes listed in it. */ static void -darwin_java_register_dyld_add_image_hook (const struct mach_header *mh, +darwin_java_register_dyld_add_image_hook (const struct JAVA_MACH_HEADER *mh, intptr_t slide) { char *fde; - uint32_t sz; + mh_size_t sz; - fde = getsectdatafromheader (mh, "__DATA", "jcr", &sz); + fde = GETSECTDATA (mh, "__DATA", "jcr", &sz); if (! fde) return; |