This is the mail archive of the
mailing list for the GDB project.
Re: ARM Simulator Bug?
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: mckennad at esatclear dot ie
- Cc: Richard Earnshaw <rearnsha at arm dot com>, gdb at sources dot redhat dot com, insight at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Tue, 02 Sep 2003 19:16:59 +0100
- Subject: Re: ARM Simulator Bug?
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> Hi Richard,
> Thanks for the reply.
> >It's more likely to be the way you are trying to get into Thumb state. Try
> > adr r0, __start_of_thumb
> Should this line not be
> adr r0, __start_of_thumb+1
> To set the LSB to tell the core we want to enter Thumb mode
Well, no. If the bottom bit isn't being set automatically when the target
is a thumb symbol then that's really a bug in the tools.
> > bx r0
> > .code 16
> > .global __start_of_thumb
> > .thumb_func
> >This is really brokenness in the way gas implements ARM and Thumb code
> >areas, but it's hard to fix properly until GAS starts using mapping
> If I use the +1 code above, and set a breakpoint at the adr command, I can single
> step successfully past the BX command and into my main.
It appears that GAS is broken:
$ cat test.s
adr r0, __thumb
$ arm-elf-as test.s -o test.o
$ arm-elf-objdump -dr test.o
test.o: file format elf32-littlearm
Disassembly of section .text:
0: e28f0000 add r0, pc, #0 ; 0x0 ####### Bzzt no!
4: e12fff10 bx r0
8: 46c0 nop (mov r8, r8)
Try using an
LDR r0, =__thumb
expression. You'll need to squeeze the constant pool in somewhere.