We currently hit the following failure: dynamiclib/init_test:jcr_test -> failed: /usr/src/lib/csu/tests/init_test.c:82: Incorrect pointer passed to _Jv_RegisterClasses [0.029s] This test is comparing jcr_ptr to jcr_func_ptr; the former being what's passed to _Jv_RegisterClasses. If I dump them in the ATF_REQUIRE_MSG, jcr_ptr == 12000 and jcr_func_ptr == 20057000; jcr_ptr == 12000 corresponds to this: $ readelf -a init_test | grep '\.jcr' ... [17] .jcr PROGBITS 00012000 002000 000000 00 WA 0 0 4 The value of jcr_func_ptr is consistent here: (gdb) print jcr_func_ptr $3 = (const void *) 0x20057000 (gdb) print &jcr_func $4 = (func_ptr *) 0x20057000 For completeness: $ readelf -a libh_csu.so | grep '\.jcr' ... [16] .jcr PROGBITS 00002000 002000 000004 00 WA 0 0 4
Kick it over to arm@, perhaps.
A commit references this bug: Author: kevans Date: Fri Nov 8 14:28:40 UTC 2019 New revision: 354541 URL: https://svnweb.freebsd.org/changeset/base/354541 Log: csu: Fix dynamiclib/init_test:jcr_test on !HAVE_CTORS archs .jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs, as we're still getting .jcr sections added -- presumably due to the reference in crtbegin. Without this terminal, the .jcr section (without data) overlaps with the next section and register_classes in crtbegin will be examining the wrong item. PR: 241439 Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D22132 Changes: head/lib/csu/common/crtend.c
A commit references this bug: Author: kevans Date: Tue Dec 3 18:58:46 UTC 2019 New revision: 355353 URL: https://svnweb.freebsd.org/changeset/base/355353 Log: MFC r354541: csu: Fix dynamiclib/init_test:jcr_test on !HAVE_CTORS archs .jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs, as we're still getting .jcr sections added -- presumably due to the reference in crtbegin. Without this terminal, the .jcr section (without data) overlaps with the next section and register_classes in crtbegin will be examining the wrong item. PR: 241439 Changes: _U stable/12/ stable/12/lib/csu/common/crtend.c