Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 2019 01:55:55 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351681 - in head: lib/libc/mips sys/mips/include
Message-ID:  <201909020155.x821ttkN046887@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Mon Sep  2 01:55:55 2019
New Revision: 351681
URL: https://svnweb.freebsd.org/changeset/base/351681

Log:
  mips: fix some mcount nits
  
  The symbol version for _mcount was removed 12 years ago in r169525 from
  gmon/Symbol.map, to be added to the per-arch Symbol.map. mips was overlooked
  in this, so _mcount has no symver. Add it back to where it should have been,
  rather than where it would go if it were added today, since we're correcting
  a historical mistake.
  
  Additionally, _mcount is getting thrown into .mdebug.abi32 in the llvm80/90
  world as it's not getting explicitly thrown into .text, so do this now. This
  fixes the libc build that was previously failing due to relocations in
  .mdebug.abi32. This is specifically due to the way clang's integrated AS
  works and that they emit the .mdebug.abiNN section early in the process. An
  LLVM bug has been submitted[0] and an agreement has been made that the
  mips backend should switch to .text following .mdebug.abiNN for
  compatibility.
  
  [0] https://bugs.llvm.org/show_bug.cgi?id=43119
  
  Reviewed by:	imp, arichardson
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D21435

Modified:
  head/lib/libc/mips/Symbol.map
  head/sys/mips/include/profile.h

Modified: head/lib/libc/mips/Symbol.map
==============================================================================
--- head/lib/libc/mips/Symbol.map	Mon Sep  2 00:39:02 2019	(r351680)
+++ head/lib/libc/mips/Symbol.map	Mon Sep  2 01:55:55 2019	(r351681)
@@ -11,6 +11,7 @@ FBSD_1.0 {
 	/* PSEUDO syscalls */
 	_exit;
 
+	_mcount;
 	_setjmp;
 	_longjmp;
 	alloca;

Modified: head/sys/mips/include/profile.h
==============================================================================
--- head/sys/mips/include/profile.h	Mon Sep  2 00:39:02 2019	(r351680)
+++ head/sys/mips/include/profile.h	Mon Sep  2 01:55:55 2019	(r351681)
@@ -46,7 +46,8 @@
 /*XXX This is not MIPS64 safe. */
 
 #define	MCOUNT \
-	__asm(".globl _mcount;"		\
+	__asm(".text;"			\
+	".globl _mcount;"		\
 	".type _mcount,@function;"	\
 	"_mcount:;"			\
 	".set noreorder;"		\



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