问题
I have searched, but not found an option that tells me what version of binutils I have on My Ubuntu. Or at least I don't know how to interpret it.
gcc -v
- tells nothing about binutils
ld -v
- tells me GNU ld (GNU Binutils for Ubuntu) 2.24
. Does this means that I have binutils 2.24?
回答1:
Yes, with ld -v
you can view the version of binutils (in your case is 2.24)
回答2:
I tested it only with the Debian 8, but I think it must be working with other Debian-based operation systems (Ubuntu, Mint, other).
dpkg -l | grep binutils
$ dpkg -l | grep binutils
ii binutils 2.25-5+deb8u1 amd64 GNU assembler, linker and binary utilities
apt-cache policy binutils
$ apt-cache policy binutils
binutils:
Installed: 2.25-5+deb8u1
Candidate: 2.25-5+deb8u1
Version table:
*** 2.25-5+deb8u1 0
500 http://ftp.ru.debian.org/debian/ jessie-proposed-updates/main amd64 Packages
100 /var/lib/dpkg/status
2.25-5 0
500 http://ftp.ru.debian.org/debian/ jessie/main amd64 Packages
500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
apt-cache show binutils (stripped)
$ apt-cache show binutils
Package: binutils
Version: 2.25-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.23.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)
..............................
ld --version
$ ld --version
GNU ld (GNU Binutils for Debian) 2.25
ar --version
$ ar --version
GNU ar (GNU Binutils for Debian) 2.25
回答3:
Try this:
sh <(dpkg -L binutils | awk '/bin\// {print $0 " --version"}') | \
grep Binutils | sort -u | column -t
This gets all the binaries in the binutils packages and queries each one with its --version parameter. I echo an empty string for those that expect input in the terminal.
来源:https://stackoverflow.com/questions/23604949/how-to-see-what-version-of-binutils-is-on-ubuntu