[ARM] Fix two cortex-a8 bugs

Nathan Sidwell nathan@codesourcery.com
Tue Aug 4 13:38:00 GMT 2009


This patch fixes a couple of cortex-a8 erratum bugs I found.

1) We were presuming that merely finding the same number of cortex-a8 fixes was 
sufficient to determine we'd converged.  This is incorrect.  We may have found a 
different fix requiring a differently sized veneer.  This causes the linker to 
blow up later (with the inscrutable 'bad value' error) when the second fix was 
longer than the first and we'd not recalculated section sizes.  As you can see 
from the test case, the trigger is two potential fixups close together, such 
that initially we find the second one, then upon recalculation an unrelated 
thumb<->arm trampoline moves things such that the first fixup is now the 
critical one.

2) We place thumb<->arm trampolines and cortex-a8 veneers in the same stub 
section.  The former are all multiples of 4 bytes and presume 4 byte alignment, 
but the latter are multiples of 2 bytes in some cases, and do not presume 
alignment.  When calculating the stub sizes we do not insert alignment padding, 
because we don't know which order the stubs will be emitted in.  The emission 
order is essentially random, being dictated by a hash table walk.  Rather than 
arbitrarily pad all veneers to 4 bytes, I changed the stub emission to do 2 
walks, one for non-cortex-a8 veneers and then a later one for those veneers. 
Thus guaranteeing the alignments required.

The latter bug is the one also found by Doug Kwan -- 
http://sourceware.org/ml/binutils/2009-07/msg00380.html.  This fix avoids the 
additional padding of Doug's patch.  Doug, if you'd like to check your testcases 
are fixed by this patch that'd be great!

tested on arm-eabi, ok?

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cortex-a8.patch
Type: text/x-patch
Size: 12337 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090804/3ab8721a/attachment.bin>


More information about the Binutils mailing list