This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports 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]

Re: [PATCH] Fix the glibc profiling issue on arm-unknown-linux-gnueabi.


Hi Joseph,

> Yes, send them here - but let's wait a week or two to see if any problems
> arise with the mainline version, before applying it to release branches.
>

I guess, we have no issue with the applied patches as there are no
problems reported.

I am attaching the patches for glibc 2.11, 2.12 which i had created
for my activity, kindly
commit them.

Thanks for your help and time.

Regards,
Manjunath S Matti
Sony India Software Centre.
--- a/glibc-ports-2.11/sysdeps/arm/sysdep.h	2011-01-28 18:06:12.000000000 +0530
+++ b/glibc-ports-2.11/sysdeps/arm/sysdep.h	2011-01-28 18:14:34.000000000 +0530
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <sysdeps/generic/sysdep.h>
+#include <features.h>
 
 #if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
      && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
@@ -89,10 +90,16 @@
 
 /* If compiled for profiling, call `mcount' at the start of each function.  */
 #ifdef	PROF
+#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__)
+#define CALL_MCOUNT			\
+	str	lr,[sp, #-4]!	;	\
+	bl	PLTJMP(mcount)	;	
+#else
 #define CALL_MCOUNT			\
 	str	lr,[sp, #-4]!	;	\
 	bl	PLTJMP(mcount)	;	\
 	ldr	lr, [sp], #4	;
+#endif
 #else
 #define CALL_MCOUNT		/* Do nothing.  */
 #endif
@@ -102,8 +109,12 @@
    on this system, the asm identifier `syscall_error' intrudes on the
    C name space.  Make sure we use an innocuous name.  */
 #define	syscall_error	__syscall_error
+#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__)
+#define mcount		__gnu_mcount_nc
+#else
 #define mcount		_mcount
 #endif
+#endif
 
 #if defined(__ARM_EABI__)
 /* Tag_ABI_align8_preserved: This code preserves 8-byte
--- a/glibc-ports-2.12/sysdeps/arm/sysdep.h	2011-01-26 02:30:16.000000000 +0530
+++ b/glibc-ports-2.12/sysdeps/arm/sysdep.h	2011-02-15 15:55:07.000000000 +0530
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <sysdeps/generic/sysdep.h>
+#include <features.h>
 
 #if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
      && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
@@ -92,6 +93,16 @@
 
 /* If compiled for profiling, call `mcount' at the start of each function.  */
 #ifdef	PROF
+/* Call __gnu_mcount_nc if GCC > 4.4 and abi = EABI */
+#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__) 
+#define CALL_MCOUNT \
+  str	lr,[sp, #-4]!; \
+  cfi_adjust_cfa_offset (4); \
+  cfi_rel_offset (lr, 0); \
+  bl PLTJMP(mcount); \
+  cfi_adjust_cfa_offset (-4); \
+  cfi_restore (lr)
+#else /* else call _mcount */
 #define CALL_MCOUNT \
   str	lr,[sp, #-4]!; \
   cfi_adjust_cfa_offset (4); \
@@ -100,6 +111,7 @@
   ldr lr, [sp], #4; \
   cfi_adjust_cfa_offset (-4); \
   cfi_restore (lr)
+#endif
 #else
 #define CALL_MCOUNT		/* Do nothing.  */
 #endif
@@ -109,8 +121,12 @@
    on this system, the asm identifier `syscall_error' intrudes on the
    C name space.  Make sure we use an innocuous name.  */
 #define	syscall_error	__syscall_error
+#if __GNUC_PREREQ(4,4) && defined(__ARM_EABI__) 
+#define mcount		__gnu_mcount_nc
+#else
 #define mcount		_mcount
 #endif
+#endif
 
 #if defined(__ARM_EABI__)
 /* Tag_ABI_align8_preserved: This code preserves 8-byte

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