mis-handling of arm semihosting in libgloss/arm/crt0.S

Can Finner can.finner@gmail.com
Mon Jun 13 13:47:00 GMT 2011


Hi,
I noticed that in libgloss/arm/crt0.S, there are codes handling
semihosting like:
#if defined(__thumb2__)
	bkpt	AngelSWI
#else
	/*  We are always in ARM mode for startup */
	AngelSWIAsm	AngelSWI_ARM
#endif

This seems not appropriate. as in semihosting doc:
" If you are compiling for the ARMv6-M or ARMv7-M, the Thumb BKPT
instruction is
used instead of the Thumb SVC instruction. Both BKPT and SVC take an
8-bit immediate
value. In all other respects, semihosting is the same for all
supported ARM processors."

Here __thumb2__ not only stands for ARMv7-M processor, but also for
thumb state on
ARMv7-A/R processors, which should use svc instead, since there are
not thumb only architectures.

Is it right? Thanks.

-- 
Regards.



More information about the Newlib mailing list