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,

>
>>> ?/* If compiled for profiling, call `mcount' at the start of each function. ?*/
>>> ?#ifdef PROF
>>> +#if __GNUC_PREREQ(4,4)
>>
>> I think the condition should also include defined(__ARM_EABI__), since
>> this is specific to EABI, though old-ABI is no longer maintained.

I am sorry about the previous patch attached, it contains only (__ARM_EABI__)
condition checking.

Below is the patch which checks for both GCC 4.4 and (__ARM_EABI__).

{{{
--- 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
}}}

Thanks you for your time and inputs.

>> --
>> Joseph S. Myers

 Regards,
 Manjunath S Matti
 Sony India Software Centre.


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