summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Shawcroft <marcus.shawcroft@linaro.org>2013-09-24 13:03:02 +0100
committerMarcus Shawcroft <marcus.shawcroft@linaro.org>2013-09-24 13:03:02 +0100
commit8f5a90c270d2d1860e87764a14d739988c53e7b2 (patch)
tree85db9820627d35ed4e837db5dbec714be16f91ee
parentcfa4df95003c963c16d2102aef9c806f8175f373 (diff)
downloadglibc-8f5a90c270d2d1860e87764a14d739988c53e7b2.tar.gz
[AArch64] Support __mcount profiling.
-rw-r--r--ports/ChangeLog.aarch645
-rw-r--r--ports/sysdeps/aarch64/machine-gmon.h15
2 files changed, 12 insertions, 8 deletions
diff --git a/ports/ChangeLog.aarch64 b/ports/ChangeLog.aarch64
index 0090872dbe..3daf3ed495 100644
--- a/ports/ChangeLog.aarch64
+++ b/ports/ChangeLog.aarch64
@@ -1,3 +1,8 @@
+2013-09-24 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
+
+ * sysdeps/aarch64/machine-gmon.h (__mcount): Accept parameter and
+ pass it to mcount_internal.
+
2013-09-24 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>
* sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h: New file.
diff --git a/ports/sysdeps/aarch64/machine-gmon.h b/ports/sysdeps/aarch64/machine-gmon.h
index 4425965a48..5cc2941258 100644
--- a/ports/sysdeps/aarch64/machine-gmon.h
+++ b/ports/sysdeps/aarch64/machine-gmon.h
@@ -16,10 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* GCC version 2 gives us a perfect magical function to get
- just the information we need:
- void *__builtin_return_address (unsigned int N)
- returns the return address of the frame N frames up. */
+/* Accept 'frompc' address as argument from the function that calls
+ __mcount for profiling. Use __builtin_return_address (0)
+ for the 'selfpc' address. */
#include <sysdep.h>
@@ -28,8 +27,8 @@ static void mcount_internal (u_long frompc, u_long selfpc);
#define _MCOUNT_DECL(frompc, selfpc) \
static inline void mcount_internal (u_long frompc, u_long selfpc)
-#define MCOUNT \
-void __mcount (void) \
-{ \
- mcount_internal ((u_long) RETURN_ADDRESS (1), (u_long) RETURN_ADDRESS (0)); \
+#define MCOUNT \
+void __mcount (void *frompc) \
+{ \
+ mcount_internal ((u_long) frompc, (u_long) RETURN_ADDRESS (0)); \
}