PIC, alignment problems with libcrypt on armv7

Antonio Borneo borneo.antonio at gmail.com
Fri Jul 1 12:09:12 CEST 2016

On Thu, Jun 30, 2016 at 11:38 PM, Jussi Kivilinna
<jussi.kivilinna at iki.fi> wrote:
> On 30.06.2016 10:43, Jussi Kivilinna wrote:
>>> The second problem showed up as a bus error running tests/basic.
>>> The problem is that ldm/stm don't deal with unaligned accesses even
>>> on armv7 (see http://www.heyrick.co.uk/armwiki/Unaligned_data_access).
>>> My workaround is to undef the gcc-defined feature symbol, but a better
>>> fix would be to strip out the conditional guards, since the alignment
>>> adjustments are needed on all versions.
>> I have made wrong assumption about unaligned accesses with ldm/stm.
>> I'll make the needed changes and add proper unaligned buffer test cases
>> so that these will be caught in future.
> Appears that there is proper tests for unaligned buffers. However those
> tests did not fail for me, since on Linux unaligned ldm/stm exception
> is caught and handled by kernel.


on arnv7 target you can disable kernel unaligned handling and enable
the unaligned fault with
echo 4 > /proc/cpu/alignment
as explained in kernel Documentation/arm/mem_alignment


More information about the Gcrypt-devel mailing list