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]

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


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.


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