This is the mail archive of the newlib@sourceware.org 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]

Re: arm-elf thumb-2 issue in newlib or gas?


Hi Andreas, Hi Mariusz,

Assembler messages:
../../../../../../../../newlib-1.16.0/newlib/libc/machine/arm/setjmp.S:123:
Error: SP not allowed in register list -- `stmea a1!,{v1-v7,fp,ip,sp,lr}'


This is a newlib issue.

Please could you try out the attached patch which I believe will resolve it for you. If you can confirm this I will check the patch in.

Cheers
  Nick

newlib/ChangeLog
2008-04-22  Nick Clifton  <nickc@redhat.com>

	* libc/machine/arm/setjmp.S: Add support for thumb2 multiple
	register load/store instructions.
Index: newlib/libc/machine/arm/setjmp.S
===================================================================
RCS file: /cvs/src/src/newlib/libc/machine/arm/setjmp.S,v
retrieving revision 1.2
diff -c -3 -p -r1.2 setjmp.S
*** newlib/libc/machine/arm/setjmp.S	7 Feb 2006 18:44:54 -0000	1.2
--- newlib/libc/machine/arm/setjmp.S	22 Apr 2008 06:57:03 -0000
*************** SYM (\name):
*** 120,126 ****
--- 120,131 ----
  	FUNC_START setjmp
  
  	/* Save all the callee-preserved registers into the jump buffer.  */
+ #ifdef __thumb2__
+ 	stmea		a1!, { v1-v7, fp, ip, lr }
+ 	str		sp, [a1],#+4
+ #else
  	stmea		a1!, { v1-v7, fp, ip, sp, lr }
+ #endif
  	
  #if 0	/* Simulator does not cope with FP instructions yet.  */
  #ifndef __SOFTFP__
*************** SYM (\name):
*** 142,148 ****
--- 147,158 ----
  	/* If we have stack extension code it ought to be handled here.  */
  	
  	/* Restore the registers, retrieving the state when setjmp() was called.  */
+ #ifdef __thumb2__
+ 	ldmfd		a1!, { v1-v7, fp, ip, lr }
+ 	ldr		sp, [a1],#+4
+ #else
  	ldmfd		a1!, { v1-v7, fp, ip, sp, lr }
+ #endif
  	
  #if 0	/* Simulator does not cope with FP instructions yet.  */
  #ifndef __SOFTFP__

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