[PATCH, GAS, ARM]. Warn on Erratum 752419.

Tejas Belagod tejas.belagod@arm.com
Fri May 6 16:16:00 GMT 2011


Hi,

Attached is a patch that warns on encountering loads of the form:

ldr sp, [rn, #const]!
ldr sp, [rn], #const

for cores that implement the v7m and 7e-m architecuture profiles. A
warning is also issued for -march=armv7 profiles. This is to catch the
erratum 752419 that says that:

"If an interrupt occurs during the data-phase of a single word load to
the stack-pointer (SP/R13), erroneous behaviour can occur. In all cases,
returning from the interrupt will result in the load instruction being
executed an additional time. For all instructions performing an update
to the base register, the base register will be erroneously updated on
each execution, resulting in the stack-pointer being loaded from an
incorrect memory location."

Therefore we warn on such cores where SP is destination register in a
load with writeback.

OK for trunk?

--
Tejas Belagod
ARM.

Changelog:

gas/

2011-06-05  Tejas Belagod  <tejas.belagod@arm.com>

	* config/tc-arm.c(do_t_ldst): Warn on loading into sp with
	writeback for appropriate cores/arch.
	* testsuite/gas/arm/ld-sp-warn-cortex-m3.d: New test.
	* testsuite/gas/arm/ld-sp-warn-cortex-m3.l: New test.
	* testsuite/gas/arm/ld-sp-warn-cortex-m4.d: New test.
	* testsuite/gas/arm/ld-sp-warn-cortex-m4.l: New test.
	* testsuite/gas/arm/ld-sp-warn-v7.d: New test.
	* testsuite/gas/arm/ld-sp-warn-v7.l: New test.
	* testsuite/gas/arm/ld-sp-warn-v7a.d: New test.
	* testsuite/gas/arm/ld-sp-warn-v7a.l: New test.
	* testsuite/gas/arm/ld-sp-warn-v7e-m.l: New test.
	* testsuite/gas/arm/ld-sp-warn-v7em.d: New test.
	* testsuite/gas/arm/ld-sp-warn-v7m.d: New test.
	* testsuite/gas/arm/ld-sp-warn-v7m.l: New test.
	* testsuite/gas/arm/ld-sp-warn-v7r.d: New test.
	* testsuite/gas/arm/ld-sp-warn-v7r.l: New test.
	* testsuite/gas/arm/ld-sp-warn.s: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 752419-5.txt
Type: text/x-patch
Size: 9161 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20110506/531809b4/attachment.bin>


More information about the Binutils mailing list