How to Detect if an ARM ELF Binary is Hard-float (ARMHF) or Soft-float (ARMEL)

If some cases you may want to know if a library or binary built for the ARM architecture is using hard-float (armhf) or soft-float (armel). You can analyze ELF binary using readefl utility, so let’s have a try.

First let’s install some armel and armhf files on a computer running Ubuntu by install gcc/g++ toolchain for armel and armhf:


We now have armhf and armel libraries installed in /usr/arm-linux-gnueabihf/lib and /usr/arm-linux-gnueabi/lib respectively. Let’s check the output of readelf filtered with “FP” string for libm.so.6 for armel:


and armhf:


Great, so there’s an extra line for armhf (Tag_ABI_VFP_args) that seems to confirm the library is hard-float.

With readelf compiled from elftoolchain-0.6.1 (source code), the extra line will be a bit different: “Tag_ABI_VFP_args: AAPCS (VFP variant)

AAPCS stands for ARM Architecture Procedure Call Standard. You can read more details on ARM website. There are also two other possible values for Tag_ABI_VFP_args: “AAPCS (base variant)” and “toolchain-specific”, but I’m not sure in which case they may be returned.

“-a” will just dump everything, but readelf also allows you to only select architecture depend information with “-A”. So beside floating point type, you can also find out about the architecture, thumb, whether it’s build with NEON support and more:

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

One Reply to “How to Detect if an ARM ELF Binary is Hard-float (ARMHF) or Soft-float (ARMEL)”

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip and Allwinner SoM and SBC products
Boardcon Rockchip and Allwinner SoM and SBC products