patches/glibc/2.2.5/initfini-sh.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 --- glibc-2.2.5/sysdeps/sh/elf/initfini.c.orig	Thu Jul  5 21:56:03 2001
     2 +++ glibc-2.2.5/sysdeps/sh/elf/initfini.c	Wed May 28 08:45:08 2003
     3 @@ -27,122 +27,122 @@
     4     * crtn.s puts the corresponding function epilogues
     5     in the .init and .fini sections. */
     6  
     7 -__asm__ ("
     8 -
     9 -#include \"defs.h\"
    10 -#define SHARED
    11 -
    12 -/*@HEADER_ENDS*/
    13 -
    14 -/*@TESTS_BEGIN*/
    15 -
    16 -/*@TESTS_END*/
    17 -
    18 -/*@_init_PROLOG_BEGINS*/
    19 -	.section .init
    20 -	.align 5
    21 -	.global	_init
    22 -	.type	_init,@function
    23 -_init:
    24 -	mov.l	r12,@-r15
    25 -	mov.l	r14,@-r15
    26 -	sts.l	pr,@-r15
    27 -#ifdef SHARED
    28 -	mova	.L22,r0
    29 -	mov.l	.L22,r12
    30 -	add	r0,r12
    31 -	mova	.L23,r0
    32 -	mov.l	.L23,r1
    33 -	add	r0,r1
    34 -#else
    35 -	mov.l	.L23,r1
    36 -#endif
    37 -	jsr	@r1
    38 -	 mov	r15,r14
    39 -	bra	1f
    40 -	 nop
    41 -	.align 2
    42 -#ifdef SHARED
    43 -.L22:
    44 -	.long	_GLOBAL_OFFSET_TABLE_
    45 -.L23:
    46 -	.long	__gmon_start__@PLT
    47 -#else
    48 -.L23:
    49 -	.long	__gmon_start__
    50 -#endif
    51 -	.data
    52 -	.global __fpscr_values
    53 -__fpscr_values:
    54 -	.long   0
    55 -	.long   0x80000
    56 -	.previous
    57 -1:
    58 -	ALIGN
    59 -	END_INIT
    60 -
    61 -	
    62 -/*@_init_PROLOG_ENDS*/
    63 -
    64 -/*@_init_EPILOG_BEGINS*/
    65 -	.section .init
    66 -	mov	r14,r15
    67 -	lds.l	@r15+,pr
    68 -	mov.l	@r15+,r14
    69 -	rts	
    70 -	mov.l	@r15+,r12
    71 -	END_INIT
    72 -	.section .text
    73 -	.align 5
    74 -	.weak	__gmon_start__
    75 -	.type	__gmon_start__,@function
    76 -__gmon_start__:
    77 -	mov.l	r14,@-r15
    78 -	mov	r15,r14
    79 -	mov	r14,r15
    80 -	rts	
    81 -	mov.l	@r15+,r14
    82 -	
    83 -/*@_init_EPILOG_ENDS*/
    84 -
    85 -/*@_fini_PROLOG_BEGINS*/
    86 -	.section .fini
    87 -	.align 5
    88 -	.global	_fini
    89 -	.type	_fini,@function
    90 -_fini:
    91 -	mov.l	r12,@-r15
    92 -	mov.l	r14,@-r15
    93 -	sts.l	pr,@-r15
    94 -#ifdef SHARED
    95 -	mova	.L27,r0
    96 -	mov.l	.L27,r12
    97 -	add	r0,r12
    98 -#endif
    99 -	mov	r15,r14
   100 -	ALIGN
   101 -	END_FINI
   102 -#ifdef SHARED
   103 -	bra	1f
   104 -	 nop
   105 -	.align	2
   106 -.L27:
   107 -	.long	_GLOBAL_OFFSET_TABLE_
   108 -#endif
   109 -1:
   110 -/*@_fini_PROLOG_ENDS*/
   111 -
   112 -/*@_fini_EPILOG_BEGINS*/
   113 -	.section .fini
   114 -	mov	r14,r15
   115 -	lds.l	@r15+,pr
   116 -	mov.l	@r15+,r14
   117 -	rts	
   118 -	mov.l	@r15+,r12
   119 -
   120 -	END_FINI
   121 -	
   122 -/*@_fini_EPILOG_ENDS*/
   123 -
   124 -/*@TRAILER_BEGINS*/
   125 +__asm__ ("\n\
   126 +\n\
   127 +#include \"defs.h\"\n\
   128 +#define SHARED\n\
   129 +\n\
   130 +/*@HEADER_ENDS*/\n\
   131 +\n\
   132 +/*@TESTS_BEGIN*/\n\
   133 +\n\
   134 +/*@TESTS_END*/\n\
   135 +\n\
   136 +/*@_init_PROLOG_BEGINS*/\n\
   137 +	.section .init\n\
   138 +	.align 5\n\
   139 +	.global	_init\n\
   140 +	.type	_init,@function\n\
   141 +_init:\n\
   142 +	mov.l	r12,@-r15\n\
   143 +	mov.l	r14,@-r15\n\
   144 +	sts.l	pr,@-r15\n\
   145 +#ifdef SHARED\n\
   146 +	mova	.L22,r0\n\
   147 +	mov.l	.L22,r12\n\
   148 +	add	r0,r12\n\
   149 +	mova	.L23,r0\n\
   150 +	mov.l	.L23,r1\n\
   151 +	add	r0,r1\n\
   152 +#else\n\
   153 +	mov.l	.L23,r1\n\
   154 +#endif\n\
   155 +	jsr	@r1\n\
   156 +	 mov	r15,r14\n\
   157 +	bra	1f\n\
   158 +	 nop\n\
   159 +	.align 2\n\
   160 +#ifdef SHARED\n\
   161 +.L22:\n\
   162 +	.long	_GLOBAL_OFFSET_TABLE_\n\
   163 +.L23:\n\
   164 +	.long	__gmon_start__@PLT\n\
   165 +#else\n\
   166 +.L23:\n\
   167 +	.long	__gmon_start__\n\
   168 +#endif\n\
   169 +	.data\n\
   170 +	.global __fpscr_values\n\
   171 +__fpscr_values:\n\
   172 +	.long   0\n\
   173 +	.long   0x80000\n\
   174 +	.previous\n\
   175 +1:\n\
   176 +	ALIGN\n\
   177 +	END_INIT\n\
   178 +\n\
   179 +	\n\
   180 +/*@_init_PROLOG_ENDS*/\n\
   181 +\n\
   182 +/*@_init_EPILOG_BEGINS*/\n\
   183 +	.section .init\n\
   184 +	mov	r14,r15\n\
   185 +	lds.l	@r15+,pr\n\
   186 +	mov.l	@r15+,r14\n\
   187 +	rts	\n\
   188 +	mov.l	@r15+,r12\n\
   189 +	END_INIT\n\
   190 +	.section .text\n\
   191 +	.align 5\n\
   192 +	.weak	__gmon_start__\n\
   193 +	.type	__gmon_start__,@function\n\
   194 +__gmon_start__:\n\
   195 +	mov.l	r14,@-r15\n\
   196 +	mov	r15,r14\n\
   197 +	mov	r14,r15\n\
   198 +	rts	\n\
   199 +	mov.l	@r15+,r14\n\
   200 +	\n\
   201 +/*@_init_EPILOG_ENDS*/\n\
   202 +\n\
   203 +/*@_fini_PROLOG_BEGINS*/\n\
   204 +	.section .fini\n\
   205 +	.align 5\n\
   206 +	.global	_fini\n\
   207 +	.type	_fini,@function\n\
   208 +_fini:\n\
   209 +	mov.l	r12,@-r15\n\
   210 +	mov.l	r14,@-r15\n\
   211 +	sts.l	pr,@-r15\n\
   212 +#ifdef SHARED\n\
   213 +	mova	.L27,r0\n\
   214 +	mov.l	.L27,r12\n\
   215 +	add	r0,r12\n\
   216 +#endif\n\
   217 +	mov	r15,r14\n\
   218 +	ALIGN\n\
   219 +	END_FINI\n\
   220 +#ifdef SHARED\n\
   221 +	bra	1f\n\
   222 +	 nop\n\
   223 +	.align	2\n\
   224 +.L27:\n\
   225 +	.long	_GLOBAL_OFFSET_TABLE_\n\
   226 +#endif\n\
   227 +1:\n\
   228 +/*@_fini_PROLOG_ENDS*/\n\
   229 +\n\
   230 +/*@_fini_EPILOG_BEGINS*/\n\
   231 +	.section .fini\n\
   232 +	mov	r14,r15\n\
   233 +	lds.l	@r15+,pr\n\
   234 +	mov.l	@r15+,r14\n\
   235 +	rts	\n\
   236 +	mov.l	@r15+,r12\n\
   237 +\n\
   238 +	END_FINI\n\
   239 +	\n\
   240 +/*@_fini_EPILOG_ENDS*/\n\
   241 +\n\
   242 +/*@TRAILER_BEGINS*/\n\
   243  ");