patches/uClibc/0.9.30.2/160-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
permissions -rw-r--r--
scripts: add option to strip all toolchain executables

To reduce filesizes of the toolchain and even improve build times
of projects to be build with this toolchain it is usefull to strip
the delivered toolchain executables. Since it is not likely that we
will debug the toolchain executables itself we do not need the
debug information inside the executables itself.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
     1 From 2911103dd4a03bbd3aad11eddfce524a5c9ba9b3 Mon Sep 17 00:00:00 2001
     2 From: Khem Raj <raj.khem@gmail.com>
     3 Date: Fri, 22 Jan 2010 13:00:20 +0100
     4 Subject: [PATCH 03/15] Make use of macros from sys/asm.h in crt1.S
     5 
     6 Needed for mips nptl to boot once again.
     7 (cherry picked from commit 9c343fd4030dcd7a52616f365893177dded50346)
     8 
     9 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
    10 ---
    11  libc/sysdeps/linux/mips/crt1.S |   46 +++++++++++----------------------------
    12  1 files changed, 13 insertions(+), 33 deletions(-)
    13 
    14 diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S
    15 index e851d52..6a80412 100644
    16 --- a/libc/sysdeps/linux/mips/crt1.S
    17 +++ b/libc/sysdeps/linux/mips/crt1.S
    18 @@ -85,29 +85,10 @@
    19  
    20  __start:
    21  #ifdef __PIC__
    22 -#if _MIPS_SIM == _MIPS_SIM_ABI32
    23 -	.frame	sp, 24, sp
    24 -        .set noreorder
    25 -	move $0, $31		/* Save old ra.  */
    26 -	bal 10f			/* Find addr of cpload.  */
    27 -        nop
    28 -10:
    29 -	.cpload $31
    30 -	move $31, $0
    31 -	.set reorder
    32 -	.cprestore 16
    33 -#else
    34 -	move $0, $31; /* Save old ra.  */
    35 -	.set noreorder
    36 -	bal 10f /* Find addr of .cpsetup.  */
    37 -	nop
    38 -10:
    39 -	.set reorder
    40 -	.cpsetup $31, $25, 10b
    41 -	move $31, $0
    42 -#endif
    43 +	SETUP_GPX($0)
    44 +	SETUP_GPX64($25,$0)
    45  #else
    46 -	la $28, _gp             /* Setup GP correctly if we're non-PIC.  */
    47 +	PTR_LA $28, _gp             /* Setup GP correctly if we're non-PIC.  */
    48  	move $31, $0
    49  #endif
    50  
    51 @@ -118,18 +99,18 @@ __start:
    52  	/* Allocate space on the stack for seven arguments and
    53  	 * make sure the stack is aligned to double words (8 bytes) */
    54  
    55 +	and $29, -2 * SZREG
    56 +
    57  #if _MIPS_SIM == _MIPS_SIM_ABI32
    58 -	and $29, -2 * 4
    59 -	subu $29, 32
    60 -	la $7, _init		/* init */
    61 -	la $8, _fini
    62 -	sw $8, 16($29)		/* fini */
    63 -	sw $2, 20($29)		/* rtld_fini */
    64 -	sw $29, 24($29)		/* stack_end */
    65 -#else
    66 -	and $29, -2 * PTRSIZE
    67 +	PTR_SUBIU $29, 32
    68 +#endif
    69  	PTR_LA $7, _init		/* init */
    70 -	PTR_LA $8, _fini		/* fini */
    71 +	PTR_LA $8, _fini
    72 +#if _MIPS_SIM == _MIPS_SIM_ABI32
    73 +	PTR_S $8, 16($29)		/* fini */
    74 +	PTR_S $2, 20($29)		/* rtld_fini */
    75 +	PTR_S $29, 24($29)		/* stack_end */
    76 +#else
    77  	move $9, $2		/* rtld_fini */
    78  	move $10, $29		/* stack_end */
    79  #endif
    80 @@ -148,4 +129,3 @@ __data_start:
    81  	.weak data_start
    82  	data_start = __data_start
    83  
    84 -
    85 -- 
    86 1.6.6.1
    87