[ARM] Cortex A8 workarounds for PLT tail calls

Richard Earnshaw rearnsha@arm.com
Fri May 6 10:01:00 GMT 2011

On Tue, 2011-04-12 at 09:34 +0100, Richard Sandiford wrote:
> The linker has some workarounds for a Cortex A8 branch erratum.  If a
> 32-bit Thumb branch straddles a page boundary, and branches to somewhere
> in the first of the two pages, the linker will redirect it to a stub in
> a different page.
> This was failing to work correctly for non-call branches to PLTs.  The stub
> is itself a Thumb branch, but it branched directly to the ARM PLT code,
> rather than to the preceding Thumb entry point.
> (Normal calls to PLTs work fine.  We use a BLX to an ARM stub,
> which should and does then branch to the main PLT entry.)
> Tested on arm-linux-gnueabi, both on binutils and GCC.  The b-plt and
> bcc-plt tests failed before the patch but pass after it.  The other two
> already passed, but I've included them for completeness.  OK to install?
> Richard
> bfd/
> 	* elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb
> 	branch to a PLT entry, redirect it to the PLT's Thumb entry point.
> ld/testsuite/
> 	* ld-arm/cortex-a8-fix-b-plt.s, ld-arm/cortex-a8-fix-b-plt.d,
> 	ld-arm/cortex-a8-fix-bcc-plt.s, ld-arm/cortex-a8-fix-bcc-plt.d,
> 	ld-arm/cortex-a8-fix-bl-plt.s, ld-arm/cortex-a8-fix-bl-plt.d,
> 	ld-arm/cortex-a8-fix-blx-plt.s, ld-arm/cortex-a8-fix-blx-plt.d,
> 	ld-arm/cortex-a8-fix-plt.ld: New tests.
> 	* ld-arm/arm-elf.exp: Run them.



More information about the Binutils mailing list