svn commit: r354541 - head/lib/csu/common
Kyle Evans
kevans at FreeBSD.org
Fri Nov 8 14:28:40 UTC 2019
Author: kevans
Date: Fri Nov 8 14:28:39 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
Modified:
head/lib/csu/common/crtend.c
Modified: head/lib/csu/common/crtend.c
==============================================================================
--- head/lib/csu/common/crtend.c Fri Nov 8 14:25:26 2019 (r354540)
+++ head/lib/csu/common/crtend.c Fri Nov 8 14:28:39 2019 (r354541)
@@ -26,9 +26,14 @@ __FBSDID("$FreeBSD$");
#include "crt.h"
-#ifdef HAVE_CTORS
typedef void (*crt_func)(void);
+static crt_func __JCR_LIST__[] __section(".jcr") __used = {
+ (crt_func)0
+};
+
+#ifdef HAVE_CTORS
+
/*
* On some architectures and toolchains we may need to call the .ctors.
* These are called in the reverse order they are in the ELF file.
@@ -39,9 +44,6 @@ static crt_func __CTOR_END__[] __section(".ctors") __u
(crt_func)0
};
static crt_func __DTOR_END__[] __section(".dtors") __used = {
- (crt_func)0
-};
-static crt_func __JCR_LIST__[] __section(".jcr") __used = {
(crt_func)0
};
More information about the svn-src-head
mailing list