This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: embedding arm instructions in thumb code
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Arvind Krishnaswamy <arvind at CS dot Arizona dot EDU>
- Cc: Richard dot Earnshaw at arm dot com, gcc at gcc dot gnu dot org
- Date: Mon, 08 Apr 2002 10:18:32 +0100
- Subject: Re: embedding arm instructions in thumb code
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> >
> > 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.