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 Andreas,

On Wed, Jan 19, 2011 at 2:49 PM, Andreas Schwab <schwab@redhat.com> wrote:
> Manjunath Matti <manjunath81@gmail.com> writes:
>
>> I guess its just replacing a one-liner with another one or are there any
>> advantages ?
>
> The advantage is that it works.
>
> Andreas.
>

I have modified the patch as follows

{{{
--- a/glibc-ports-2.11/sysdeps/arm/sysdep.h     2011-01-19
17:53:21.000000000 +0530
+++ b/glibc-ports-2.11/sysdeps/arm/sysdep.h     2011-01-19
17:54:14.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)
+#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)
+#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 for your comment.

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]