Open-Source Internship opportunity by OpenGenus for programmers. Apply now.
In this article, we will check different commands using which you can get the binutils version installed in your system. Binutils comes with GCC but if you have upgraded GCC by building from source, binutils might not get updated and can result in errors.
The easiest way to check binutils version in UNIX system is to use the following comamnd:
ld -v
OR
ld --version
The output will include the binutils version as follows:
GNU ld (GNU Binutils for Ubuntu) 2.39
In our case, the version of Binutils is 2.39 which is the latest version as of September 2022.
Other commands to check binutils version are as follows:
1. Use ar to get binutils version
ar --version
Output will be as follows:
GNU ar (GNU Binutils for Debian) 2.30
Binutils is a collection of different binary tools so getting the version of any of the tools, one can get the version of Binutils. The 3 main tools in Binutils are:
- ld
- ar
- gold
There are several other tools such as addr2line, c++filt, dlltool, nm, objdump, size, strings, windmc, gprof and much more.
Just like we got the version of binutils from ld and ar, one can use the same command with other tools to get the same information.
1. Use dpkg to get binutils version
dpkg -l | grep binutils
The output will be as follows:
ii binutils 2.39-5+deb8u1 amd64 GNU assembler, linker and binary utilities
2. Use apt-cache to get binutils version
apt-cache policy binutils
The output will be as follows:
binutils:
Installed: 2.39-5+deb8u1
Candidate: 2.39-5+deb8u1
Version table:
*** 2.39-5+deb8u1 0
500 http://ftp.ru.debian.org/debian/ jessie-proposed-updates/main amd64 Packages
100 /var/lib/dpkg/status
2.39-5 0
500 http://ftp.ru.debian.org/debian/ jessie/main amd64 Packages
500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
3. Use apt-cache show to get binutils version
apt-cache show binutils
The output will be as follows:
Package: binutils
Version: 2.39-5+deb8u1
Installed-Size: 20566
Maintainer: Matthias Klose <doko@debian.org>
Architecture: amd64
Replaces: binutils-gold (<< 2.20.51.20100415), binutils-mingw-w64-i686 (<< 2.39.52.20130612-1+3), binutils-mingw-w64-x86-64 (<< 2.23.52.20130612-1+3)
Provides: binutils-gold, elf-binutils
Depends: libc6 (>= 2.14), zlib1g (>= 1:1.2.0)
Suggests: binutils-doc (>= 2.25-5+deb8u1)
..............................
With this article at OpenGenus, you must have the complete idea of how to get the version of binutils in your UNIX system.