This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: embedding arm instructions in thumb code


> >
> > BUT,
> >
> > > ..
> > > ..
> > > bx r15
> > > [thumb insts]
> >
> > This won't work, since the Thumb bit isn't set in the PC.
> >
> 
> Isn't it possible to set the thumb bit in the PC using orr r15, r15, #1 ?

No, only certain instructions can trigger a mode change.  The general 
arithmetic instructions don't.

About the only sequence I can think of that will work on V4T is

	adr	Rn, Thumb_code
	orr	Rn, Rn, #1
	bx	Rn
	.code 16
Thumb_code:
	...

> Does objdump recognize such arm code within thumb code? When I try to disassemble
> the object code, objdump seems to be interpreting the arm instructions as thumb.

This is a limitation in the current way that we assemble files[1].  You 
should be able to work around the limitation by putting a temporary label 
at the start of the ARM code sequence.

[1] The problem will be fixed when we get mapping symbols to work 
correctly with the GNU tools.

R.


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