diff options
author | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-08 23:33:51 +0000 |
---|---|---|
committer | green <green@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-08 23:33:51 +0000 |
commit | 2cee371fc4ff421e7ee390cec4b7f3b2cfa2a0f1 (patch) | |
tree | b2a3074871661348b009c02745413b72c17c05ab /gcc/crtstuff.c | |
parent | aa9ca075e0c6df55b8210160564689f7a9749916 (diff) | |
download | ppe42-gcc-2cee371fc4ff421e7ee390cec4b7f3b2cfa2a0f1.tar.gz ppe42-gcc-2cee371fc4ff421e7ee390cec4b7f3b2cfa2a0f1.zip |
2001-08-08 Anthony Green <green@redhat.com>
* java/class.c (emit_register_classes): Use assemble_jcr if
possible. Keep the original mechanism as a fallback.
* defaults.h (JCR_SECTION_NAME): Define if we have named section
and weak symbol support.
* crtstuff.c (__JCR_LIST__): Define.
(__JCR_END__): Define.
(_Jv_RegiserClasses): Define weak symbol if possible.
(__do_global_ctors_aux): Register classes for ELF targets with
weak symbol support.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44731 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/crtstuff.c')
-rw-r--r-- | gcc/crtstuff.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index 75e944176c2..c74377eefee 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -415,6 +415,14 @@ char __EH_FRAME_BEGIN__[] = { }; #endif /* EH_FRAME_SECTION_NAME */ +#ifdef JCR_SECTION_NAME +/* Stick a label at the beginning of the java class registration info + so we can register them properly. */ + +STATIC void *__JCR_LIST__[] __attribute__ ((unused, section(JCR_SECTION_NAME))) + = { 0 }; +#endif /* JCR_SECTION_NAME */ + #endif /* defined(CRT_BEGIN) */ #ifdef CRT_END @@ -423,11 +431,25 @@ char __EH_FRAME_BEGIN__[] #ifdef OBJECT_FORMAT_ELF +#ifdef JCR_SECTION_NAME +extern void _Jv_RegisterClasses (void *) __attribute__((weak)); +static void *__JCR_END__[]; +#endif + static func_ptr __CTOR_END__[]; static void __do_global_ctors_aux (void) { func_ptr *p; +#ifdef JCR_SECTION_NAME + void **jcr; + if (_Jv_RegisterClasses) + { + for (jcr = __JCR_END__ - 1; *jcr != NULL; jcr--); + if (*(jcr + 1)) + _Jv_RegisterClasses (jcr + 1); + } +#endif for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--) (*p) (); } @@ -543,6 +565,14 @@ STATIC int __FRAME_END__[] = { 0 }; #endif /* EH_FRAME_SECTION */ +#ifdef JCR_SECTION_NAME +/* Stick a label at the beginning of the java class registration info + so we can register them properly. */ + +STATIC void *__JCR_END__[1] + __attribute__ ((unused, section(JCR_SECTION_NAME))) = { 0 }; +#endif /* JCR_SECTION_NAME */ + #endif /* defined(CRT_END) */ #else /* OBJECT_FORMAT_MACHO */ |