git: a60615d5be83 - main - csu: drop support for GCJ
- Reply: Brooks Davis : "Re: git: a60615d5be83 - main - csu: drop support for GCJ"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 18 Apr 2025 18:59:55 UTC
The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=a60615d5be83ca050d4ddfbbb4411ca7a8a11486 commit a60615d5be83ca050d4ddfbbb4411ca7a8a11486 Author: Brooks Davis <brooks@FreeBSD.org> AuthorDate: 2025-04-18 18:49:01 +0000 Commit: Brooks Davis <brooks@FreeBSD.org> CommitDate: 2025-04-18 18:59:19 +0000 csu: drop support for GCJ Remove .jcr sections and related infrastructure. This has no impact on existing binaries and the toolchain remains capability of linking them, but would require different (or additional) csu files. GCC removed GCJ from trunk in on September 30, 2016. Our support came in with D17587 for compatibility with old object files. It was roughly contemporaneous with GCC 6.5, the last release with GCJ support. At this point we don't even have a compiler port capable of producing GCJ binaries so there is no need to carry this around any more. For reference see: https://en.wikipedia.org/wiki/GNU_Compiler_for_Java#History Reviewed by: kib, emaste Discussed with: imp Sponsored by: SRI International Differential Revision: https://reviews.freebsd.org/D49882 --- lib/csu/common/crtbegin.c | 33 --------------------------------- lib/csu/common/crtend.c | 4 ---- lib/csu/tests/init_test.c | 30 ------------------------------ share/man/man5/elf.5 | 3 +++ 4 files changed, 3 insertions(+), 67 deletions(-) diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c index 06fe990052f7..8ef9b8923c21 100644 --- a/lib/csu/common/crtbegin.c +++ b/lib/csu/common/crtbegin.c @@ -98,36 +98,3 @@ asm ( ".popsection \n" ); #endif - -/* - * Handler for gcj. These provide a _Jv_RegisterClasses function and fill - * out the .jcr section. We just need to call this function with a pointer - * to the appropriate section. - */ -extern void _Jv_RegisterClasses(void *) __weak_symbol; -static void register_classes(void) __used; - -static crt_func __JCR_LIST__[] __section(".jcr") __used = { }; - -#ifndef CTORS_CONSTRUCTORS -__attribute__((constructor)) -#endif -static void -register_classes(void) -{ - - if (_Jv_RegisterClasses != NULL && __JCR_LIST__[0] != 0) - _Jv_RegisterClasses(__JCR_LIST__); -} - -/* - * We can't use constructors when they use the .ctors section as they may be - * placed before __CTOR_LIST__. - */ -#ifdef CTORS_CONSTRUCTORS -asm ( - ".pushsection .init \n" - "\t" INIT_CALL_SEQ(register_classes) "\n" - ".popsection \n" -); -#endif diff --git a/lib/csu/common/crtend.c b/lib/csu/common/crtend.c index bf25c1d836a9..9eb75de2ef60 100644 --- a/lib/csu/common/crtend.c +++ b/lib/csu/common/crtend.c @@ -26,10 +26,6 @@ typedef void (*crt_func)(void); -static crt_func __JCR_END__[] __section(".jcr") __used = { - (crt_func)0 -}; - #ifdef HAVE_CTORS /* diff --git a/lib/csu/tests/init_test.c b/lib/csu/tests/init_test.c index 47bd9b7e64d7..2d4484735f76 100644 --- a/lib/csu/tests/init_test.c +++ b/lib/csu/tests/init_test.c @@ -38,9 +38,6 @@ typedef void (*func_ptr)(void); -extern volatile int jcr_run; -extern const func_ptr *jcr_ptr; -extern const void *jcr_func_ptr; extern volatile int ctors_run; extern volatile int preinit_array_run; extern volatile int preinit_array_state; @@ -48,37 +45,11 @@ extern volatile int init_array_run; extern volatile int init_array_state; #ifndef DSO_BASE -volatile int jcr_run; -const func_ptr *jcr_ptr; volatile int ctors_run; volatile int preinit_array_run; volatile int preinit_array_state = -1; volatile int init_array_run; volatile int init_array_state = -1; - -void _Jv_RegisterClasses(const func_ptr *); - -__section(".jcr") __used static func_ptr jcr_func = (func_ptr)1; -const void *jcr_func_ptr = &jcr_func; - -void -_Jv_RegisterClasses(const func_ptr *jcr) -{ - - jcr_run = 1; - jcr_ptr = jcr; -} -#endif - -#ifndef DSO_LIB -ATF_TC_WITHOUT_HEAD(jcr_test); -ATF_TC_BODY(jcr_test, tc) -{ - - ATF_REQUIRE_MSG(jcr_run == 1, ".jcr not run"); - ATF_REQUIRE_MSG(jcr_ptr == jcr_func_ptr, - "Incorrect pointer passed to _Jv_RegisterClasses"); -} #endif #ifndef DSO_BASE @@ -160,7 +131,6 @@ ATF_TC_BODY(init_array_test, tc) ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, jcr_test); ATF_TP_ADD_TC(tp, ctors_test); ATF_TP_ADD_TC(tp, preinit_array_test); ATF_TP_ADD_TC(tp, init_array_test); diff --git a/share/man/man5/elf.5 b/share/man/man5/elf.5 index 7ad469a03c3b..5bd71efcb56c 100644 --- a/share/man/man5/elf.5 +++ b/share/man/man5/elf.5 @@ -1065,6 +1065,9 @@ and .It .jcr This section holds information about Java classes that must be registered. +It is obsolete and binaries created for +.Fx 15 +or later do not process it. .It .eh_frame This section holds information used for C++ exception-handling. .El