Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Feb 2018 17:01:10 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328939 - head/contrib/gcc/config/mips
Message-ID:  <201802061701.w16H1Akh079603@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Feb  6 17:01:10 2018
New Revision: 328939
URL: https://svnweb.freebsd.org/changeset/base/328939

Log:
  Use a workaround to compile the crt init functions correctly with clang.
  
  The MIPS assembly parser treats forward-declared local symbols as global
  symbols.  This results in CALL16 relocations being used against local
  (private) symbols which then fail to resolve when linking binaries.
  Add .local to force the init and fini functions to be treated as local as
  a workaround.
  
  Submitted by:	sbruno
  Sponsored by:	DARPA / AFRL

Modified:
  head/contrib/gcc/config/mips/mips.h

Modified: head/contrib/gcc/config/mips/mips.h
==============================================================================
--- head/contrib/gcc/config/mips/mips.h	Tue Feb  6 16:02:33 2018	(r328938)
+++ head/contrib/gcc/config/mips/mips.h	Tue Feb  6 17:01:10 2018	(r328939)
@@ -2721,6 +2721,7 @@ while (0)
 	nop\n\
 1:	.cpload $31\n\
 	.set reorder\n\
+	.local " USER_LABEL_PREFIX #FUNC "\n\
 	jal " USER_LABEL_PREFIX #FUNC "\n\
 	" TEXT_SECTION_ASM_OP);
 #endif /* Switch to #elif when we're no longer limited by K&R C.  */
@@ -2733,6 +2734,7 @@ while (0)
 	nop\n\
 1:	.set reorder\n\
 	.cpsetup $31, $2, 1b\n\
+	.local " USER_LABEL_PREFIX #FUNC "\n\
 	jal " USER_LABEL_PREFIX #FUNC "\n\
 	" TEXT_SECTION_ASM_OP);
 #endif



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