This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix missing _mcount@GLIBC_2.0 on powerpc32

This brings back _mcount@GLIBC_2.0 on powerpc32.


	[BZ #14042]
	* sysdeps/powerpc/powerpc32/ppc-mcount.S [SHARED]: Don't use PLT
	for call to __mcount_internal.
	* sysdeps/powerpc/powerpc32/Makefile (sysdep_routines)
	[$(subdir) = gmon]: Add old-ppc-mcount.
	* sysdeps/powerpc/powerpc32/old-ppc-mcount.S: New file.

diff --git a/sysdeps/powerpc/powerpc32/Makefile b/sysdeps/powerpc/powerpc32/Makefile
index aa2d0b9..458a45f 100644
--- a/sysdeps/powerpc/powerpc32/Makefile
+++ b/sysdeps/powerpc/powerpc32/Makefile
@@ -6,7 +6,7 @@ sysdep-LDFLAGS += -msoft-float
 ifeq ($(subdir),gmon)
-sysdep_routines += ppc-mcount
+sysdep_routines += ppc-mcount old-ppc-mcount
 static-only-routines += ppc-mcount
diff --git a/sysdeps/powerpc/powerpc32/old-ppc-mcount.S b/sysdeps/powerpc/powerpc32/old-ppc-mcount.S
new file mode 100644
index 0000000..6be5bf6
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/old-ppc-mcount.S
@@ -0,0 +1,10 @@
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_15)
+# define _mcount __old_mcount
+# include "ppc-mcount.S"
+# undef _mcount
+compat_symbol (libc, __old_mcount, _mcount, GLIBC_2_0)
diff --git a/sysdeps/powerpc/powerpc32/ppc-mcount.S b/sysdeps/powerpc/powerpc32/ppc-mcount.S
index 9a3c041..911638b 100644
--- a/sysdeps/powerpc/powerpc32/ppc-mcount.S
+++ b/sysdeps/powerpc/powerpc32/ppc-mcount.S
@@ -1,5 +1,5 @@
 /* PowerPC-specific implementation of profiling support.
-   Copyright (C) 1997, 1999, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    The GNU C Library is free software; you can redistribute it and/or
@@ -57,7 +57,11 @@ ENTRY(_mcount)
 	stw	r4, 44(r1)
 	cfi_offset (lr, -4)
 	stw	r5,  8(r1)
+#ifndef SHARED
 	bl	JUMPTARGET(__mcount_internal)
+	bl	__mcount_internal@local
  /* Restore the registers...  */
 	lwz     r6,  8(r1)
 	lwz	r0, 44(r1)

Andreas Schwab,
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]