What is it?

ELFinfo is a small utility for showing information about ELF files

What can it do?

It can show information about which machine an ELF file has been compiled for, if it's stripped or not, if it's big or little endian and which compiler and version has been used to compile the file.
It can detect compiler version for files compiled with the Go, GCC, OCaml or FPC compilers.


Running this command:

elfinfo -l /usr/bin/ls

Gives this output:

/usr/bin/ls: stripped=true, compiler=GCC 6.3.1, byteorder=LittleEndian, machine=Advanced Micro Devices x86-64

The details will be different for other platforms.


Which arguments are supported?

Source code and bug tracker

The source and issue tracker is available at GitHub.

git clone git://github.com/xyproto/elfinfo.git


64-bit Linux

The following commands downloads the latest binary release from GitHub and installs it:

        cd /tmp
        curl -LO https://github.com/xyproto/elfinfo/releases/download/1.2.2/elfinfo
        sudo install -Dm755 elfinfo /usr/bin/elfinfo

Commands will be slightly different or macOS or BSD.

As a Go script

This requires a working Go interpreter in /usr/bin/go:

        cd /tmp
        curl -LO https://raw.githubusercontent.com/xyproto/elfinfo/1.2.2/main.go
        sudo install -Dm755 main.go /usr/bin/elfinfo.go
        echo -e '#!/bin/sh\n/usr/bin/go run /usr/bin/elfinfo.go "$@"' > elfinfo.sh
        sudo install -Dm755 elfinfo.sh /usr/bin/elfinfo

Commands will be slightly different on macOS or BSD.

Using the latest development version

        go get -u github.com/xyproto/elfinfo


ELFinfo 1.2.2
Alexander F. Rødseth, 2023