[PATCH] Make ARM GAS accept valid STR instruction

Jie Zhang jie@codesourcery.com
Mon Aug 23 16:00:00 GMT 2010


On 08/21/2010 05:03 AM, Daniel Jacobowitz wrote:
> On Wed, Aug 18, 2010 at 04:28:07PM +0800, Jie Zhang wrote:
>> `str r0,[pc,#4]' is a valid instruction although the use of PC is
>> deprecated. But currently GAS rejects this instruction. This patch
>> should fix it. Tested using GAS testsuite for arm-none-eabi target.
>> Is it OK?
>
> Where (on what architectures) is the use of PC deprecated?  It's
> documented as fine in the ARM v5 reference; I do not think we should
> warn unconditionally, but then, some other code in gas does.  At least
> check warn_on_deprecated.
>
> swp{b} warns only of armv6 or later, that might be the right model here.
>
Thanks! That's a good idea. I checked the manuals. It's deprecated since 
ARMv7-A. So I changed my patch accordingly. The new patch is attached. 
In the new patch, I just removed the valid instruction from the test and 
inserted a blank line to keep the line numbers of the following lines 
unchanged to avoid massive line number changes in test dump file. 
Compared to the last version of the patch, I added the valid str 
instruction to the new test added by the this patch.

Tested GAS for arm-none-eabi, no regressions found.

Is it OK now?


Regards,
--
Jie Zhang
CodeSourcery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-arm-allow-pc-in-str-addr-2.diff
Type: text/x-patch
Size: 4690 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100823/e28a54ee/attachment.bin>


More information about the Binutils mailing list