Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/csu/common_elf Add support for registering Java classes ...
details: https://anonhg.NetBSD.org/src/rev/3112d7e14392
branches: trunk
changeset: 519934:3112d7e14392
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sun Dec 30 23:45:00 2001 +0000
description:
Add support for registering Java classes emitted by the Java compiler
(e.g. the Java compiler in GCC 3.x) into the ".jcr" section.
diffstat:
lib/csu/common_elf/Makefile.inc | 3 ++-
lib/csu/common_elf/crtbegin.c | 14 +++++++++++++-
lib/csu/common_elf/crtend.c | 7 ++++++-
3 files changed, 21 insertions(+), 3 deletions(-)
diffs (73 lines):
diff -r 4e0bbcf4cded -r 3112d7e14392 lib/csu/common_elf/Makefile.inc
--- a/lib/csu/common_elf/Makefile.inc Sun Dec 30 23:26:20 2001 +0000
+++ b/lib/csu/common_elf/Makefile.inc Sun Dec 30 23:45:00 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.10 2001/11/05 15:11:40 lukem Exp $
+# $NetBSD: Makefile.inc,v 1.11 2001/12/30 23:45:00 thorpej Exp $
.if !defined(ELFSIZE)
ELFSIZE=32
@@ -11,6 +11,7 @@
CPPFLAGS+= -I${.CURDIR}/../common_elf
CPPFLAGS+= -I${.CURDIR}/../../libc/dlfcn
CPPFLAGS+= -DDWARF2_EH
+CPPFLAGS+= -DJCR
.if !defined(MACHINE_ARCH) || ${MACHINE_ARCH} != "m68000"
COPTS+= -fPIC
diff -r 4e0bbcf4cded -r 3112d7e14392 lib/csu/common_elf/crtbegin.c
--- a/lib/csu/common_elf/crtbegin.c Sun Dec 30 23:26:20 2001 +0000
+++ b/lib/csu/common_elf/crtbegin.c Sun Dec 30 23:45:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crtbegin.c,v 1.15 2001/12/30 23:26:20 thorpej Exp $ */
+/* $NetBSD: crtbegin.c,v 1.16 2001/12/30 23:45:01 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -68,6 +68,13 @@
__attribute__((section(".eh_frame"), aligned(4))) = { };
#endif
+#if defined(JCR) && defined(__GNUC__)
+extern void _Jv_RegisterClasses(void *) __attribute__((weak));
+
+static void *__JCR_LIST__[]
+ __attribute__((section(".jcr"))) = { };
+#endif
+
static void __dtors(void);
static void __ctors(void);
@@ -129,6 +136,11 @@
#endif /* __GNUC__ */
#endif /* DWARF2_EH */
+#if defined(JCR) && defined(__GNUC__)
+ if (__JCR_LIST__[0] != NULL && _Jv_RegisterClasses != NULL)
+ _Jv_RegisterClasses(__JCR_LIST__);
+#endif /* JCR && __GNUC__ */
+
__ctors();
}
}
diff -r 4e0bbcf4cded -r 3112d7e14392 lib/csu/common_elf/crtend.c
--- a/lib/csu/common_elf/crtend.c Sun Dec 30 23:26:20 2001 +0000
+++ b/lib/csu/common_elf/crtend.c Sun Dec 30 23:45:00 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crtend.c,v 1.8 2001/08/03 05:54:44 thorpej Exp $ */
+/* $NetBSD: crtend.c,v 1.9 2001/12/30 23:45:01 thorpej Exp $ */
#include <sys/cdefs.h>
#include "dot_init.h"
@@ -16,6 +16,11 @@
__attribute__((section(".eh_frame"))) = { 0 };
#endif
+#if defined(JCR) && defined(__GNUC__)
+static void *__JCR_END__[1]
+ __attribute__((__unused__, section(".jcr"))) = { (void *) 0 };
+#endif
+
MD_INIT_SECTION_EPILOGUE;
MD_FINI_SECTION_EPILOGUE;
Home |
Main Index |
Thread Index |
Old Index