patches/gcc/3.3.1/sh-pic-set_fpscr.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 See http://gcc.gnu.org/PR11901
     2 Should fix
     3 make[2]: *** [/gcc-3.3-glibc-2.3.2/build-glibc/elf/check-textrel.out] Error 1 
     4 in glibc's "make tests".
     5 
     6 -------------
     7 
     8 Message-Id: <200307300255.h6U2tB906928@r-rr.iij4u.or.jp>
     9 To: dank@kegel.com
    10 Cc: linux-sh@m17n.org
    11 Subject: Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails
    12  with "libc.so: text relocations used" in glibc-2.3.2 for sh4)
    13 In-Reply-To: Your message of "Wed, 30 Jul 2003 11:20:49 +0900"
    14 	<200307300212.h6U2CH901209@r-rr.iij4u.or.jp>
    15 References: <200307300212.h6U2CH901209@r-rr.iij4u.or.jp>
    16 Date: Wed, 30 Jul 2003 12:03:01 +0900
    17 From: kaz Kojima <kkojima@rr.iij4u.or.jp>
    18 
    19 > I'll try to write the PIC version of it,
    20 
    21 Dan, does the attached patch work for you?
    22 
    23 [dank: original patch deleted; here's same thing rediffed against gcc-3.3 instead of HEAD]
    24 
    25 --- gcc-3.3/gcc/config/sh/lib1funcs.asm.old	Tue Jul 29 21:37:29 2003
    26 +++ gcc-3.3/gcc/config/sh/lib1funcs.asm	Tue Jul 29 21:40:58 2003
    27 @@ -1792,7 +1792,17 @@
    28  	.global GLOBAL(set_fpscr)
    29  GLOBAL(set_fpscr):
    30  	lds r4,fpscr
    31 +#ifdef __PIC__
    32 +	mov.l	r12,@-r15
    33 +	mova	LOCAL(set_fpscr_L0),r0
    34 +	mov.l	LOCAL(set_fpscr_L0),r12
    35 +	add	r0,r12
    36 +	mov.l	LOCAL(set_fpscr_L1),r0
    37 +	mov.l	@(r0,r12),r1
    38 +	mov.l	@r15+,r12
    39 +#else
    40  	mov.l LOCAL(set_fpscr_L1),r1
    41 +#endif
    42  	swap.w r4,r0
    43  	or #24,r0
    44  #ifndef FMOVD_WORKS
    45 @@ -1820,8 +1830,16 @@
    46  	mov.l r3,@(4,r1)
    47  #endif
    48  	.align 2
    49 +#ifdef __PIC__
    50 +LOCAL(set_fpscr_L0):
    51 +	.long _GLOBAL_OFFSET_TABLE_
    52 +LOCAL(set_fpscr_L1):
    53 +	.long GLOBAL(fpscr_values@GOT)
    54 +#else
    55  LOCAL(set_fpscr_L1):
    56  	.long GLOBAL(fpscr_values)
    57 +#endif
    58 +
    59  #ifdef __ELF__
    60          .comm   GLOBAL(fpscr_values),8,4
    61  #else