patches/gcc/3.3.2/sh-pic-set_fpscr-gcc-3.3.2.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 Note: this patch is named
     7 sh-pic-set_fpscr-gcc-3.3.2.patch
     8 and must be applied after 
     9 sh-lib1funcs_sizeAndType.patch
    10 but that'll happen naturally if you apply them in alphabetical order.
    11 
    12 -------------
    13 
    14 Date: Wed, 30 Jul 2003 12:03:01 +0900
    15 From: kaz Kojima <kkojima@rr.iij4u.or.jp>
    16 Subject: [linux-sh:02916] Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails
    17  with "libc.so: text relocations used" in glibc-2.3.2 for sh4)
    18 To: dank@kegel.com
    19 Cc: linux-sh@m17n.org
    20 Message-Id: <200307300255.h6U2tB906928@r-rr.iij4u.or.jp>
    21 
    22 > I'll try to write the PIC version of it,
    23 
    24 Dan, does the attached patch work for you?
    25 
    26 Regards,
    27 	kaz
    28 --
    29 diff -u3prN ORIG/gcc/gcc/config/sh/lib1funcs.asm LOCAL/gcc/gcc/config/sh/lib1funcs.asm
    30 --- ORIG/gcc/gcc/config/sh/lib1funcs.asm	Thu Jun 19 07:38:59 2003
    31 +++ gcc-3.3.2/gcc/config/sh/lib1funcs.asm	Wed Jul 30 11:08:49 2003
    32 @@ -1936,7 +1944,17 @@ GLOBAL(moddi3):
    33  	FUNC(GLOBAL(set_fpscr))
    34  GLOBAL(set_fpscr):
    35  	lds r4,fpscr
    36 +#ifdef __PIC__
    37 +	mov.l	r12,@-r15
    38 +	mova	LOCAL(set_fpscr_L0),r0
    39 +	mov.l	LOCAL(set_fpscr_L0),r12
    40 +	add	r0,r12
    41 +	mov.l	LOCAL(set_fpscr_L1),r0
    42 +	mov.l	@(r0,r12),r1
    43 +	mov.l	@r15+,r12
    44 +#else
    45  	mov.l LOCAL(set_fpscr_L1),r1
    46 +#endif
    47  	swap.w r4,r0
    48  	or #24,r0
    49  #ifndef FMOVD_WORKS
    50 @@ -1964,8 +1982,15 @@ GLOBAL(set_fpscr):
    51  	mov.l r3,@(4,r1)
    52  #endif
    53  	.align 2
    54 +#ifdef __PIC__
    55 +LOCAL(set_fpscr_L0):
    56 +	.long _GLOBAL_OFFSET_TABLE_
    57 +LOCAL(set_fpscr_L1):
    58 +	.long GLOBAL(fpscr_values@GOT)
    59 +#else
    60  LOCAL(set_fpscr_L1):
    61  	.long GLOBAL(fpscr_values)
    62 +#endif
    63  
    64  	ENDFUNC(GLOBAL(set_fpscr))
    65  #ifndef NO_FPSCR_VALUES
    66 
    67