Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2019 18:58:45 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r355353 - stable/12/lib/csu/common
Message-ID:  <201912031858.xB3IwjOn067771@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Dec  3 18:58:45 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

Modified:
  stable/12/lib/csu/common/crtend.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/csu/common/crtend.c
==============================================================================
--- stable/12/lib/csu/common/crtend.c	Tue Dec  3 18:57:32 2019	(r355352)
+++ stable/12/lib/csu/common/crtend.c	Tue Dec  3 18:58:45 2019	(r355353)
@@ -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
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912031858.xB3IwjOn067771>