[Fwd: Building newlib for arm - setjmp.S and thumb?]

J. Johnston jjohnstn@cygnus.com
Thu Mar 29 17:53:00 GMT 2001


Nick Clifton wrote:
> 
> Hi Kurt,
> 
> > ../../../../../../../newlib-1.9.0/newlib/libc/sys/arm/setjmp.S:
> > Assembler messages:
> > ../../../../../../../newlib-1.9.0/newlib/libc/sys/arm/setjmp.S:97:
> > Error: r15 not allowed here
> > ../../../../../../../newlib-1.9.0/newlib/libc/sys/arm/setjmp.S:117:
> > Error: r15 not allowed here
> 
> Hmm, these messages appear to be for the FUNC_START macro.  The Thumb
> version of this macro uses the code sequence:
> 
>         BX PC
>         NOP
> 
> to switch into ARM mode.
> 
> 
> The reason that the assembler is confused, and thinks that it is in
> ARM mode is that the .thumb_func directive in the 2.10.1 assembelr
> sources did not automatically select thumb mode.  You can easily work
> around this by editing the setjmp.S source file and changing:
> 
>   .macro PROLOGUE name
>         bx      pc
>         nop
>         .code 32
> to:
> 
>   .macro PROLOGUE name
>         .code 16                        <---- added line
>         bx      pc
>         nop
>         .code 32
> 

I have checked the patch in.

-- Jeff J.



More information about the Newlib mailing list