[openssl-dev] [openssl.org #3753] BUG: arm support ASM code incorrect for BE8

Martin Husemann via RT rt at openssl.org
Wed Mar 18 08:45:07 UTC 2015


The ARM assembly code implements some probing for the CPU at runtime
and uses hard coded byte sequences for the probe code.

This way does not work for arm object file formats using new big endian
(BE8) mode. It is, however, very simple to fix:

The armv4cpuid.S code (generated from armv4cpuid.PL) looks like this:

_armv8_aes_probe:
        .byte   0x00,0x03,0xb0,0xf3     @ aese.8        q0,q0
        bx      lr

but it should simply be:

_armv8_aes_probe:
	.inst	0xf3b00300	     @ aese.8        q0,q0
        bx      lr


The .inst pseudo op outputs 32bit as instruction (with whatever byte swapping
or $a markup is required for the object format in use) - hint from Matt Thomas.

Fixing this may be enough to remove the "can not build universal binary for
big endian arm" configure failure, with maybe a few ifdefs for BE8 vs. BE32
big endian formats.

While here I notice that the generated .S files always encode "RET" as "bx lr",
even on armv4 machines.

Martin




More information about the openssl-dev mailing list