patches/glibc/2.2.5/glibc-2.2.5-mips-build-gmon.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 28 21:34:41 2007 +0000 (2007-07-28)
changeset 301 2be7232a73ac
permissions -rw-r--r--
Bump version to 0.2.2.
     1 From http://www.ltc.com/~brad/mips/glibc-2.2.5-mips-build-gmon.diff
     2 See http://www.ltc.com/~brad/mips/mips-cross-toolchain.html
     3 
     4 --- glibc-2.2.5/sysdeps/mips/machine-gmon.h	2001-08-13 04:42:44.000000000 -0400
     5 +++ glibc-2.2.5/sysdeps/mips/machine-gmon.h	2002-09-25 17:10:59.000000000 -0400
     6 @@ -17,42 +17,52 @@
     7     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
     8     02111-1307 USA.  */
     9  
    10 -#define _MCOUNT_DECL static void __mcount
    11 +#define _MCOUNT_DECL(frompc,selfpc) \
    12 +static void __attribute_used__ __mcount (u_long frompc, u_long selfpc)
    13  
    14  /* Call __mcount with our the return PC for our caller,
    15     and the return PC our caller will return to.  */
    16  #ifdef __PIC__
    17  #define CPLOAD ".cpload $25;"
    18 +#define CPRESTORE ".cprestore 44\n\t"
    19  #else
    20  #define CPLOAD
    21 +#define CPRESTORE
    22  #endif
    23  
    24  #define MCOUNT asm(\
    25 -	".globl _mcount;" \
    26 -	".align 2;" \
    27 -	".type _mcount,@function;" \
    28 -        "_mcount:;" \
    29 -        ".set noreorder;" \
    30 -        ".set noat;" \
    31 +	".globl _mcount;\n\t" \
    32 +	".align 2;\n\t" \
    33 +	".type _mcount,@function;\n\t" \
    34 +	".ent _mcount\n\t" \
    35 +        "_mcount:\n\t" \
    36 +        ".frame $sp,44,$31\n\t" \
    37 +        ".set noreorder;\n\t" \
    38 +        ".set noat;\n\t" \
    39          CPLOAD \
    40 -        "sw $4,8($29);" \
    41 -        "sw $5,12($29);" \
    42 -        "sw $6,16($29);" \
    43 -        "sw $7,20($29);" \
    44 -        "sw $1,0($29);" \
    45 -        "sw $31,4($29);" \
    46 -        "move $5,$31;" \
    47 -        "move $4,$1;" \
    48 -        "jal __mcount;" \
    49 -	"nop;" \
    50 -        "lw $4,8($29);" \
    51 -        "lw $5,12($29);" \
    52 -        "lw $6,16($29);" \
    53 -        "lw $7,20($29);" \
    54 -        "lw $31,4($29);" \
    55 -        "lw $1,0($29);" \
    56 -        "addu $29,$29,8;" \
    57 -        "j $31;" \
    58 -        "move $31,$1;" \
    59 -        ".set reorder;" \
    60 -        ".set at");
    61 +	"subu $29,$29,48;\n\t" \
    62 +	CPRESTORE \
    63 +        "sw $4,24($29);\n\t" \
    64 +        "sw $5,28($29);\n\t" \
    65 +        "sw $6,32($29);\n\t" \
    66 +        "sw $7,36($29);\n\t" \
    67 +        "sw $2,40($29);\n\t" \
    68 +        "sw $1,16($29);\n\t" \
    69 +        "sw $31,20($29);\n\t" \
    70 +        "move $5,$31;\n\t" \
    71 +        "move $4,$1;\n\t" \
    72 +        "jal __mcount;\n\t" \
    73 +        "nop;\n\t" \
    74 +        "lw $4,24($29);\n\t" \
    75 +        "lw $5,28($29);\n\t" \
    76 +        "lw $6,32($29);\n\t" \
    77 +        "lw $7,36($29);\n\t" \
    78 +        "lw $2,40($29);\n\t" \
    79 +        "lw $31,20($29);\n\t" \
    80 +        "lw $1,16($29);\n\t" \
    81 +        "addu $29,$29,56;\n\t" \
    82 +        "j $31;\n\t" \
    83 +        "move $31,$1;\n\t" \
    84 +        ".set reorder;\n\t" \
    85 +        ".set at\n\t" \
    86 +        ".end _mcount");