]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 6 Oct 2004 22:09:35 +0000 (22:09 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 6 Oct 2004 22:09:35 +0000 (22:09 +0000)
2004-10-06  Alan Modra  <amodra@bigpond.net.au>

* gmon/Makefile (CFLAGS-mcount.c): Move before inclusion of "Rules".
* sysdeps/powerpc/powerpc64/Makefile (CFLAGS-mcount.c): Add
-msoft-float.
* sysdeps/powerpc/powerpc64/sysdep.h (SAVE_ARG, REST_ARG): New macros.
(CALL_MCOUNT): Replace with a gas macro implementation.
(EALIGN): Delete PROF version.
* sysdeps/powerpc/powerpc64/__longjmp-common.S: Invoke CALL_MCOUNT.
* sysdeps/powerpc/powerpc64/bsd-_setjmp.S: Likewise.
* sysdeps/powerpc/powerpc64/bsd-setjmp.S: Likewise.
* sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
* sysdeps/powerpc/powerpc64/memcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/memset.S: Likewise.
* sysdeps/powerpc/powerpc64/stpcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/strchr.S: Likewise.
* sysdeps/powerpc/powerpc64/strcmp.S: Likewise.
* sysdeps/powerpc/powerpc64/strcpy.S: Likewise.
* sysdeps/powerpc/powerpc64/strlen.S: Likewise.
* sysdeps/powerpc/powerpc64/strncmp.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_floor.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_llrintf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_llround.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_rint.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_round.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.

* sysdeps/powerpc/powerpc64/setjmp-common.S: Add extra entry point
past _mcount call.
* sysdeps/powerpc/powerpc64/bsd-_setjmp.S: Use it.
* sysdeps/powerpc/powerpc64/bsd-setjmp.S: Likewise.

31 files changed:
ChangeLog
gmon/Makefile
sysdeps/powerpc/powerpc64/Makefile
sysdeps/powerpc/powerpc64/__longjmp-common.S
sysdeps/powerpc/powerpc64/bsd-_setjmp.S
sysdeps/powerpc/powerpc64/bsd-setjmp.S
sysdeps/powerpc/powerpc64/fpu/s_ceil.S
sysdeps/powerpc/powerpc64/fpu/s_ceilf.S
sysdeps/powerpc/powerpc64/fpu/s_copysign.S
sysdeps/powerpc/powerpc64/fpu/s_floor.S
sysdeps/powerpc/powerpc64/fpu/s_floorf.S
sysdeps/powerpc/powerpc64/fpu/s_llrint.S
sysdeps/powerpc/powerpc64/fpu/s_llrintf.S
sysdeps/powerpc/powerpc64/fpu/s_llround.S
sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
sysdeps/powerpc/powerpc64/fpu/s_rint.S
sysdeps/powerpc/powerpc64/fpu/s_rintf.S
sysdeps/powerpc/powerpc64/fpu/s_round.S
sysdeps/powerpc/powerpc64/fpu/s_roundf.S
sysdeps/powerpc/powerpc64/fpu/s_trunc.S
sysdeps/powerpc/powerpc64/fpu/s_truncf.S
sysdeps/powerpc/powerpc64/memcpy.S
sysdeps/powerpc/powerpc64/memset.S
sysdeps/powerpc/powerpc64/setjmp-common.S
sysdeps/powerpc/powerpc64/stpcpy.S
sysdeps/powerpc/powerpc64/strchr.S
sysdeps/powerpc/powerpc64/strcmp.S
sysdeps/powerpc/powerpc64/strcpy.S
sysdeps/powerpc/powerpc64/strlen.S
sysdeps/powerpc/powerpc64/strncmp.S
sysdeps/powerpc/powerpc64/sysdep.h

index e0245eb811a7e52fb3dd2535bd7c30aa8e9842f0..609c18daec3a82e57621d4dd9ddc7583b503bf7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2004-10-06  Alan Modra  <amodra@bigpond.net.au>
+
+       * gmon/Makefile (CFLAGS-mcount.c): Move before inclusion of "Rules".
+       * sysdeps/powerpc/powerpc64/Makefile (CFLAGS-mcount.c): Add
+       -msoft-float.
+       * sysdeps/powerpc/powerpc64/sysdep.h (SAVE_ARG, REST_ARG): New macros.
+       (CALL_MCOUNT): Replace with a gas macro implementation.
+       (EALIGN): Delete PROF version.
+       * sysdeps/powerpc/powerpc64/__longjmp-common.S: Invoke CALL_MCOUNT.
+       * sysdeps/powerpc/powerpc64/bsd-_setjmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/bsd-setjmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/setjmp-common.S: Likewise.
+       * sysdeps/powerpc/powerpc64/memcpy.S: Likewise.
+       * sysdeps/powerpc/powerpc64/memset.S: Likewise.
+       * sysdeps/powerpc/powerpc64/stpcpy.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strchr.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strcmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strcpy.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strlen.S: Likewise.
+       * sysdeps/powerpc/powerpc64/strncmp.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_floor.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llrintf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llround.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_rint.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_round.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.
+
+       * sysdeps/powerpc/powerpc64/setjmp-common.S: Add extra entry point
+       past _mcount call.
+       * sysdeps/powerpc/powerpc64/bsd-_setjmp.S: Use it.
+       * sysdeps/powerpc/powerpc64/bsd-setjmp.S: Likewise.
+
 2004-10-06  Ulrich Drepper  <drepper@redhat.com>
 
        * resolv/res_mkquery.c (res_nmkquery): Reject randombits value if
index 060ede1f8f5ca40a661a3010e75df632a475c37e..80a79456f72c704d2f6f0e4a6af0a60c198d7ade 100644 (file)
@@ -29,11 +29,11 @@ elide-routines.os = bb_init_func bb_exit_func
 
 tests  := tst-sprofil
 
-include ../Rules
-
 # The mcount code won't work without a frame pointer.
 CFLAGS-mcount.c := -fno-omit-frame-pointer
 
+include ../Rules
+
 # We cannot compile mcount.c with -pg because that would
 # create recursive calls.  Just copy the normal static object.
 # On systems where `profil' is not a system call, the same
index 758b856854829cdb8f0fcacb750331bd9350762b..3ced6568df0a496dc27dcb6f737881fd2d6d3f5d 100644 (file)
@@ -22,3 +22,10 @@ ifeq ($(subdir),elf)
 # help gcc inline asm code from dl-machine.h
 +cflags += -finline-limit=2000
 endif
+
+ifeq ($(subdir),gmon)
+# The assembly functions assume that fp arg regs are not trashed.
+# Compiling with -msoft-float ensures that fp regs are not used
+# for moving memory around.
+CFLAGS-mcount.c += -msoft-float
+endif
index b11a0fd7b53a437ebb0ed6aab1eb86392ef527d4..9d0195dd147fa5bcff86d754129c2c6b5d62cb43 100644 (file)
@@ -42,6 +42,7 @@
 
        .machine        "altivec"
 ENTRY (BP_SYM (__longjmp))
+       CALL_MCOUNT 2
        CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
 #ifndef __NO_VMX__
        ld    r5,.LC__dl_hwcap@toc(r2)
index 13f405670618016303fbfac02e46a88f9efa5d80..82b79a80986fa449c59ab669e9a4b69a2777cca8 100644 (file)
@@ -25,8 +25,9 @@
 #if defined NOT_IN_libc
 /* Build a non-versioned object for rtld-*.  */
 ENTRY (BP_SYM (_setjmp))
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__sigsetjmp))
+       b JUMPTARGET (__sigsetjmp_ent)
 END (BP_SYM (_setjmp))
 libc_hidden_def (_setjmp)
 
@@ -36,8 +37,9 @@ libc_hidden_def (_setjmp)
 symbol_version (__novmx_setjmp,_setjmp,GLIBC_2.3);
 
 ENTRY (BP_SYM (__novmx_setjmp))
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__novmx__sigsetjmp))
+       b JUMPTARGET (__novmx__sigsetjmp_ent)
 END (BP_SYM (__novmx_setjmp))
 libc_hidden_def (__novmx_setjmp)
 # endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4) */
@@ -50,13 +52,15 @@ ENTRY (BP_SYM (__GI__setjmp))
 #if defined SHARED && !defined IS_IN_rtld
        std r2,40(r1)   /* Save the callers TOC in the save area.  */
 #endif
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__vmx__sigsetjmp))
+       b JUMPTARGET (__vmx__sigsetjmp_ent)
 END (BP_SYM (__GI__setjmp))
 
 ENTRY (BP_SYM (__vmx_setjmp))
+       CALL_MCOUNT 1
        li r4,0                 /* Set second argument to 0.  */
-       b JUMPTARGET(BP_SYM (__vmx__sigsetjmp))
+       b JUMPTARGET (__vmx__sigsetjmp_ent)
 END (BP_SYM (__vmx_setjmp))
 libc_hidden_def (__vmx_setjmp)
 #endif /* !NOT_IN_libc */
index 73b9a4d34ecda7d34503ca218eac02471fc002ef..543e83faa3185f671697ed3cc7df936cb2bf6f1d 100644 (file)
@@ -25,8 +25,9 @@
 
 
 ENTRY (__novmxsetjmp)
+       CALL_MCOUNT 1
        li r4,1                 /* Set second argument to 1.  */
-       b JUMPTARGET (__novmx__sigsetjmp)
+       b JUMPTARGET (__novmx__sigsetjmp_ent)
 END (__novmxsetjmp)
 strong_alias (__novmxsetjmp, __novmx__setjmp)
 symbol_version (__novmxsetjmp, setjmp, GLIBC_2.3)
@@ -35,8 +36,9 @@ symbol_version (__novmxsetjmp, setjmp, GLIBC_2.3)
 
 
 ENTRY (__vmxsetjmp)
+       CALL_MCOUNT 1
        li r4,1                 /* Set second argument to 1.  */
-       b JUMPTARGET (__vmx__sigsetjmp)
+       b JUMPTARGET (__vmx__sigsetjmp_ent)
 END (__vmxsetjmp)
 strong_alias (__vmxsetjmp, __vmx__setjmp)
 strong_alias (__vmx__sigsetjmp, __setjmp)
index 127f302666212ae16112729160ca3a1db3f41b0c..a1bfaa70c2b6833a585f81208b0e08d6edec1151 100644 (file)
@@ -27,6 +27,7 @@
        .section        ".text"
 
 ENTRY (__ceil)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 34f61423cc89cc77a97968a3aba605a54eea2500..42eb274389cbe5c6ba442b9ef034beb60f9f5d94 100644 (file)
@@ -27,6 +27,7 @@
        .section        ".text"
 
 ENTRY (__ceilf)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 40fd83d3d1606206c47de836f5474a2f693460db..a43ed12cf0e978b7e056a92ab455d504cc4d1182 100644 (file)
@@ -23,6 +23,7 @@
 #include <sysdep.h>
 
 ENTRY(__copysign)
+       CALL_MCOUNT 0
 /* double [f1] copysign (double [f1] x, double [f2] y);
    copysign(x,y) returns a value with the magnitude of x and
    with the sign bit of y.  */
index 57fd63cd66f9a649fcc84c18dbed44303f0e2d61..80cbdc570930a0f765d86e4fc21b7010c18899fb 100644 (file)
@@ -25,6 +25,7 @@
        .section        ".text"
 
 ENTRY (__floor)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index cde92b9174f7e60a1a349b50317da923cf58f528..20cbb15ebd8c456275ac6a1d53c8c31670687814 100644 (file)
@@ -25,6 +25,7 @@
        .section        ".text"
 
 ENTRY (__floorf)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index bc976a7edbb559fbdc564e22b624cc18b247d67a..610b561f25f1e58dd8677c005ca71337cf86189d 100644 (file)
@@ -21,6 +21,7 @@
 
 /* long long int[r3] __llrint (double x[fp1])  */
 ENTRY (__llrint)       
+       CALL_MCOUNT 0
        fctid   fp13,fp1
        stfd    fp13,-16(r1)
        nop     /* Insure the following load is in a different dispatch group */
index aef84de8317f0863146e272f647ccf05d0d1f875..b7b2a8fc6354ab4f713e8195413612b67f4afc1e 100644 (file)
@@ -21,6 +21,7 @@
 
 /* long long int[r3] __llrintf (float x[fp1])  */
 ENTRY (__llrintf)      
+       CALL_MCOUNT 0
        fctid   fp13,fp1
        stfd    fp13,-16(r1)
        nop     /* Insure the following load is in a different dispatch group */
index 320ef0f6d8edd804bb69d42a3556b7b88d113dcd..a3dcd4c33d1883571701fc0ec731b86fb77dfbe8 100644 (file)
@@ -37,6 +37,7 @@
    to the integer value.  */
 
 ENTRY (__llround)
+       CALL_MCOUNT 0
        lfd     fp12,.LC0@toc(2)
        lfd     fp10,.LC1@toc(2)
        fcmpu   cr6,fp1,fp12    /* if (x > 0.0)  */
index ff923056b1bc057f80064c686ec280989f44e5bb..b5ca43bf2078ed1f706a598c84141843d1adffaf 100644 (file)
@@ -37,6 +37,7 @@
    to the integer value.  */
 
 ENTRY (__llroundf)
+       CALL_MCOUNT 0
        lfd     fp12,.LC0@toc(2)
        lfd     fp10,.LC1@toc(2)
        fcmpu   cr6,fp1,fp12    /* if (x < 0.0)  */
index f7db7ff80adfd5ae111baffdc6d6614f83066fbc..79e807269dfa6b81d4b461375c73f08291811bef 100644 (file)
@@ -28,6 +28,7 @@
        .section        ".text"
 
 ENTRY (__rint)
+       CALL_MCOUNT 0
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
        fsub    fp12,fp13,fp13  /* generate 0.0  */
index de6d654796103f04177975dfa2f0ae54cf18b25f..eb34dd5e77c5e5191adf71a03814e5c6d3ce37c9 100644 (file)
@@ -25,6 +25,7 @@
        .section        ".text"
 
 ENTRY (__rintf)
+       CALL_MCOUNT 0
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
        fsubs   fp12,fp13,fp13  /* generate 0.0  */
index 1c2e5299e565329128e3b49be449a367bb4a78f1..c0b6d46feaf252a38aa8c18e52ca889f46cad687 100644 (file)
@@ -39,6 +39,7 @@
    to the integer value.  */
 
 ENTRY (__round)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index fd8eb0aea38b3761dfaa98fa5aa085ad10afa9c4..23ee4c052b75ae067f54fc3562ab0cb1f7a46726 100644 (file)
@@ -39,6 +39,7 @@
    to the integer value.  */
 
 ENTRY (__roundf )
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index dc345ab424ffd59463094ecfb38c0a368fb9fbd7..3ddd2985259fad67e6b915768f4a82cbb5528c97 100644 (file)
@@ -34,6 +34,7 @@
    subtracting +-2**52.  */
 
 ENTRY (__trunc)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 727647f6de33a40c9afeb17624b10d9f49b2c721..b38b722a6f4c11175ed5887e531ffdbeb0e88776 100644 (file)
@@ -34,6 +34,7 @@
    subtracting +-2**23.  */
 
 ENTRY (__truncf)
+       CALL_MCOUNT 0
        mffs    fp11            /* Save current FPU rounding mode.  */
        lfd     fp13,.LC0@toc(2)
        fabs    fp0,fp1
index 251e1fed8094b0014a238f7d3656cf4dcdd08479..9df5bb42b6b4f9cdd6f02e4756eb59db0bc6d4f9 100644 (file)
@@ -37,6 +37,8 @@
    Each case has a optimized unrolled loop.   */
 
 EALIGN (BP_SYM (memcpy), 5, 0)
+       CALL_MCOUNT 3
+
     cmpldi cr1,5,31
     neg   0,3
     std   3,-16(1)
index f3a299d5c8055dfde05e6f9ff6b9e8de4a0dae88..1abc59bb1728c5f4b0409b48bf390cebba97421c 100644 (file)
@@ -41,6 +41,7 @@
    to 0, to take advantage of the dcbz instruction.  */
 
 EALIGN (BP_SYM (memset), 5, 0)
+       CALL_MCOUNT 3
 
 #define rTMP   r0
 #define rRTN   r3      /* Initial value of 1st argument.  */
@@ -274,6 +275,7 @@ libc_hidden_builtin_def (memset)
 /* Copied from bzero.S to prevent the linker from inserting a stub
    between bzero and memset.  */
 ENTRY (BP_SYM (__bzero))
+       CALL_MCOUNT 3
 #if __BOUNDED_POINTERS__
        mr      r6,r4
        li      r5,0
index ab57170875c7a9927e7c593d30c8fd0e38e815a8..f82d5a21f5a189cb41edfc6967761d27160f4743 100644 (file)
 
        .machine        "altivec"
 ENTRY (BP_SYM (__sigsetjmp))
+       CALL_MCOUNT 2
+       .globl JUMPTARGET(GLUE(__sigsetjmp,_ent))
+       .hidden JUMPTARGET(GLUE(__sigsetjmp,_ent))
+JUMPTARGET(GLUE(__sigsetjmp,_ent)):
        CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
        std  r1,(JB_GPR1*8)(3)
        mflr r0
index deac0ea22981fc940dd27c7a3a4fd9fcc990b87f..cc7a6ab66a31ac6cf72a4ce938f9dee7dd77a755 100644 (file)
@@ -26,6 +26,7 @@
 /* char * [r3] stpcpy (char *dest [r3], const char *src [r4])  */
 
 EALIGN (BP_SYM (__stpcpy), 4, 0)
+       CALL_MCOUNT 2
 
 #define rTMP   r0
 #define rRTN   r3
index e3222f354d41af2850170ae7537fa91e03da4c3d..93ea61e49c4b9494bf1797ca004ed6a492242bb3 100644 (file)
@@ -26,6 +26,7 @@
 /* char * [r3] strchr (const char *s [r3] , int c [r4] )  */
 
 ENTRY (BP_SYM (strchr))
+       CALL_MCOUNT 2
 
 #define rTMP1  r0
 #define rRTN   r3      /* outgoing result */
index 7e2dae07f7c78f1e8649dfd09712a0e0c555c6fa..4d7eb21bf721c996751158436274b5e4564d3bec 100644 (file)
@@ -26,6 +26,7 @@
 /* int [r3] strcmp (const char *s1 [r3], const char *s2 [r4])  */
 
 EALIGN (BP_SYM(strcmp), 4, 0)
+       CALL_MCOUNT 2
 
 #define rTMP   r0
 #define rRTN   r3
index 4d12b82e5e3030be42f75838da32b80bda0dca78..e9e9fc78cd977b6113c4c70c8e994daa05c4a8e3 100644 (file)
@@ -26,6 +26,7 @@
 /* char * [r3] strcpy (char *dest [r3], const char *src [r4])  */
 
 EALIGN (BP_SYM (strcpy), 4, 0)
+       CALL_MCOUNT 2
 
 #define rTMP   r0
 #define rRTN   r3      /* incoming DEST arg preserved as result */
index 760be5884a5016889913aeaafa309f0d30477acb..4c1385aead6864e5446d238bc02539948923457d 100644 (file)
@@ -79,6 +79,7 @@
 /* int [r3] strlen (char *s [r3])  */
 
 ENTRY (BP_SYM (strlen))
+       CALL_MCOUNT 1
 
 #define rTMP1  r0
 #define rRTN   r3      /* incoming STR arg, outgoing result */
index bdcfab99e35035e3f650e3550396bb8c248db596..04bdc2f6069fc23ccaaa67f08e75517d5efbef3f 100644 (file)
@@ -26,6 +26,7 @@
 /* int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t size [r5])  */
 
 EALIGN (BP_SYM(strncmp), 4, 0)
+       CALL_MCOUNT 3
 
 #define rTMP   r0
 #define rRTN   r3
index 4420a6dfacbb21222d1807be5c87a6f749247687..fead0b578a2aea71fa41a51b929218c68e1b37e6 100644 (file)
 
 #ifdef __ASSEMBLER__
 
+/* Support macros for CALL_MCOUNT.  */
+       .macro SAVE_ARG NARG
+       .if \NARG
+       SAVE_ARG \NARG-1
+       std     2+\NARG,-72+8*(\NARG)(1)
+       .endif
+       .endm
+
+       .macro REST_ARG NARG
+       .if \NARG
+       REST_ARG \NARG-1
+       ld      2+\NARG,40+8*(\NARG)(1)
+       .endif
+       .endm
+
 /* If compiled for profiling, call `_mcount' at the start of each function.
    see ppc-mcount.S for more details.  */
+       .macro CALL_MCOUNT NARG
 #ifdef PROF
-/* The mcount code relies on a the return address being on the stack
-   to locate our caller and so it can restore it; so store one just
-   for its benefit.  */
-#ifdef SYSV_ELF_PROFILING
-#define CALL_MCOUNT    \
-  .pushsection;                        \
-  .section ".data";            \
-  .align ALIGNARG(2);          \
-__mcount:                      \
-  .long  0;                    \
-  .previous;                   \
-  .section ".toc","aw";                \
-.LC__mcount:;                  \
-  .tc __mcount[TC],__mcount;   \
-  .previous;                   \
-  mflr  r0;                    \
-  std   r0,16(r1);             \
-  ld    r0,.LC__mcount@toc(r2);        \
-  bl    JUMPTARGET(_mcount);
-#else /* SYSV_ELF_PROFILING */
-#define CALL_MCOUNT    \
-  mflr  r0;                    \
-  std   r0,16(r1);             \
-  bl    JUMPTARGET(_mcount);
-#endif /* SYSV_ELF_PROFILING */
-#else  /* PROF */
-#define CALL_MCOUNT            /* Do nothing.  */
-#endif /* PROF */
+       mflr    r0
+       SAVE_ARG \NARG
+       std     r0,16(r1)
+       stdu    r1,-112(r1)
+       bl      JUMPTARGET (_mcount)
+       ld      r0,128(r1)
+       REST_ARG \NARG
+       addi    r1,r1,112
+       mtlr    r0
+#endif
+       .endm
 
 #ifdef USE_PPC64_OVERLAPPING_OPD
 # define OPD_ENT(name) .quad BODY_LABEL (name), .TOC.@tocbase
@@ -106,24 +105,11 @@ BODY_LABEL(name):
 
 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
    past a 2^alignt boundary.  */
-#ifdef PROF
-#define EALIGN(name, alignt, words) \
-       ENTRY_2(name)                           \
-       .align ALIGNARG(alignt);                \
-       EALIGN_W_##words;                       \
-BODY_LABEL(name):                              \
-       CALL_MCOUNT                             \
-       b 0f;                                   \
-       .align ALIGNARG(alignt);                \
-       EALIGN_W_##words;                       \
-0:
-#else /* PROF */
 #define EALIGN(name, alignt, words) \
        ENTRY_2(name)                           \
        .align ALIGNARG(alignt);                \
        EALIGN_W_##words;                       \
 BODY_LABEL(name):
-#endif
 
 /* Local labels stripped out by the linker.  */
 #undef L