Skip to main content

Detect software floating point usage in arm binaries

Project description

Code style: black Travis (.com) branch PyPI version PyPI pyversions

🔍 arm-float-detector

Utility to detect soft float/double math library inclusion in arm binaries (objects/archives/elfs).

# install
$ pip install arm-float-detector

# run
$ arm-float-detector --double a.out && echo OK
No soft double libs found!
OK

Requirements

Besides python, needs the nm utility. If you're on *nix, you probably have it.

What is this

Some processors do not have single- and/or double-precision floating point hardware, but instead rely on float math software libraries, which are relatively slow and add take up additional space in the application.

Unfortunately I can't find options for gcc/ld to detect and prohibit (eg warnings/errors/configuration options) using these functions; I believe the definitions are in the compiler somehow (TODO actually research this).

This utility enables detecting usage of this soft floating point libraries in binaries, suitable for being integrated into a CI check to prevent them.

Features

  1. detect presence of single- or double-precision soft floating point libraries
  2. TODO whitelist objects allowed to reference these libs (eg vsprintf)
  3. TODO enable printing objects containing the references for simpler elimination

NOTE only tested on linux, where grep supports -E 'string|string'. You use a mac, good for you, no idea if this will work there. Dependency on grep will probably be removed in the future.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for arm-float-detector, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size arm_float_detector-0.2.1-py2.py3-none-any.whl (4.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page