This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ARM Thumb byte stores
- To: jlarmour at redhat dot com
- Subject: Re: ARM Thumb byte stores
- From: Nick Clifton <nickc at redhat dot com>
- Date: Tue, 6 Feb 2001 12:07:38 -0800
- CC: binutils at sources dot redhat dot com
Hi Jifl,
: arm-elf-gcc -mthumb generates the following instruction:
:
: .code 16
: strb r3, [sp]
:
: However this seems to be falling foul of a check in
: gas/config/tc-arm.c:5863:
:
: if (Rb == REG_PC || Rb == REG_SP)
: {
: if (size != THUMB_WORD)
: {
: inst.error = _("byte or halfword not valid for base register");
: return;
: }
:
: The size in this case is obviously THUMB_BYTE, not THUMB_WORD. So is this
: check in gas correct? Or is this a gcc problem. I don't know much about
: Thumb, sorry.
It is a GCC bug. The STRB instruction in Thumb mode can only take a
"low" register (r0 - r7) as the base address register. The STR
instruction has an extra mode where it can also use the stack pointer
(SP) as an address register.
What is the source code/command line that is generating this
assembler?
Cheers
Nick