diff options
author | Kurt Miller <kurt@cvs.openbsd.org> | 2009-04-13 20:15:25 +0000 |
---|---|---|
committer | Kurt Miller <kurt@cvs.openbsd.org> | 2009-04-13 20:15:25 +0000 |
commit | 9356401dfa136c8ac2aa9ff9742b450f3ce9584d (patch) | |
tree | f94b42c4afed3baec27547e130833f84463143a2 /lib/csu/common_elf/crtbeginS.c | |
parent | 08a47d8286ecde4f4fdc9d2549824f6db3e7375b (diff) |
Add gcj java class registration hooks for gcc3 elf archs. From NetBSD
with minor differences.
okay kettenis@ drahn@
Diffstat (limited to 'lib/csu/common_elf/crtbeginS.c')
-rw-r--r-- | lib/csu/common_elf/crtbeginS.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/csu/common_elf/crtbeginS.c b/lib/csu/common_elf/crtbeginS.c index 693b7879a4a..80779c626c1 100644 --- a/lib/csu/common_elf/crtbeginS.c +++ b/lib/csu/common_elf/crtbeginS.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crtbeginS.c,v 1.9 2009/02/04 19:43:48 kettenis Exp $ */ +/* $OpenBSD: crtbeginS.c,v 1.10 2009/04/13 20:15:24 kurt Exp $ */ /* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */ /* @@ -47,6 +47,18 @@ #include "extern.h" /* + * java class registration hooks + */ + +#if (__GNUC__ > 2) +static void *__JCR_LIST__[] + __attribute__((section(".jcr"), aligned(sizeof(void*)))) = { }; + +extern void _Jv_RegisterClasses (void *) + __attribute__((weak)); +#endif + +/* * Include support for the __cxa_atexit/__cxa_finalize C++ abi for * gcc > 2.x. __dso_handle is NULL in the main program and a unique * value for each C++ shared library. For more info on this API, see: @@ -118,6 +130,12 @@ _do_init(void) */ if (!initialized) { initialized = 1; + +#if (__GNUC__ > 2) + if (__JCR_LIST__[0] && _Jv_RegisterClasses) + _Jv_RegisterClasses(__JCR_LIST__); +#endif + __ctors(); } } |