This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Update v850 crt0.S file


Hi Guys,

  This patch fixes a couple of problems with the crt0.o file for the
  v850 port:

    * Only three stack slots were being reserved before calling
      main().  Under some circumstances main can try to save all the
      arguments registers (r6-r9) which required four empty stack
      slots.

    * The crt0.o file was always being compiled with -mv850, even when
      the target was the v850e processor.  This meant that the 'ctbp'
      system register was never initialised and so code that uses the
      v850e call table instructions never worked.

    * The files still tested for the redundant v850ea port.
    
  May I apply this patch please ?

Cheers
        Nick

2003-07-31  Nick Clifton  <nickc@redhat.com>

	* libc/sys/sysnecv850/crt0.S (_start): Allocate 4 slots on stack
	before calling main, in case it saves its argument registers.
        Remove reference to deleted v850ea port.
        * configure.host: Remove reference to deleted v850ea port.
        Do not use -mv850 when building for v850e target.  This
	prevents the ctbp system register from being initialised.

Index: libc/sys/sysnecv850/crt0.S
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/sysnecv850/crt0.S,v
retrieving revision 1.2
diff -c -3 -p -r1.2 crt0.S
*** libc/sys/sysnecv850/crt0.S	27 Sep 2002 20:26:00 -0000	1.2
--- libc/sys/sysnecv850/crt0.S	31 Jul 2003 10:56:39 -0000
***************
*** 5,11 ****
  
  _start:
  
! #if defined __v850e__ || defined __v850ea__
  	
  	movea   255,		r0,	r20
  	mov     65535,		r21
--- 5,11 ----
  
  _start:
  
! #if defined __v850e__
  	
  	movea   255,		r0,	r20
  	mov     65535,		r21
*************** _start:
*** 23,29 ****
  	bl      .L0
  .L1:
  	jarl    ___main,	r31
! 	addi    -12,		sp,	sp
  	mov     0,		r6
  	mov     0,		r7
  	mov     0,		r8
--- 23,29 ----
  	bl      .L0
  .L1:
  	jarl    ___main,	r31
! 	addi    -16,		sp,	sp
  	mov     0,		r6
  	mov     0,		r7
  	mov     0,		r8
*************** _start:
*** 53,59 ****
  	bl      .L0
  .L1:
  	jarl    ___main,	r31
! 	addi    -12,		sp,	sp
  	mov     0,		r6
  	mov     0,		r7
  	mov     0,		r8
--- 53,59 ----
  	bl      .L0
  .L1:
  	jarl    ___main,	r31
! 	addi    -16,		sp,	sp
  	mov     0,		r6
  	mov     0,		r7
  	mov     0,		r8

Index: configure.host
===================================================================
RCS file: /cvs/src/src/newlib/configure.host,v
retrieving revision 1.53
diff -c -3 -p -r1.53 configure.host
*** configure.host	25 Jul 2003 16:06:00 -0000	1.53
--- configure.host	31 Jul 2003 10:56:39 -0000
*************** case "${host_cpu}" in
*** 206,216 ****
  	;;
    v850e)
  	machine_dir=v850
! 	newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 "
! 	;;
!   v850ea)
! 	machine_dir=v850
! 	newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mv850 "
  	;;
    w65*)
  	machine_dir=w65
--- 206,212 ----
  	;;
    v850e)
  	machine_dir=v850
! 	newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED "
  	;;
    w65*)
  	machine_dir=w65
        


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]