eDeviser
eDeviser

Reputation: 1873

Understanding the gcc abbreviations

I just took a look to the gcc-arm-none-eabi compiler binaries which are listed bellow but I really do not know all the used abbreviations. I would like to know which binary is the preprocessor, the linker, the compiler and so on ...

$ ls /opt/gcc-arm-none-eabi-5_4-2016q3/bin/
arm-none-eabi-addr2line
arm-none-eabi-ar
arm-none-eabi-as
arm-none-eabi-c++
arm-none-eabi-c++filt
arm-none-eabi-cpp
arm-none-eabi-elfedit
arm-none-eabi-g++
arm-none-eabi-gcc
arm-none-eabi-gcc-5.4.1
arm-none-eabi-gcc-ar
arm-none-eabi-gcc-nm
arm-none-eabi-gcc-ranlib
arm-none-eabi-gcov
arm-none-eabi-gcov-tool
arm-none-eabi-gdb
arm-none-eabi-gdb-py
arm-none-eabi-gprof
arm-none-eabi-ld
arm-none-eabi-ld.bfd
arm-none-eabi-nm
arm-none-eabi-objcopy
arm-none-eabi-objdump
arm-none-eabi-ranlib
arm-none-eabi-readelf
arm-none-eabi-size
arm-none-eabi-strings
arm-none-eabi-strip

I just can guess: gcc is the compiler? ld is the linker? What is the exact purpose of all these binaries?

Upvotes: 4

Views: 1229

Answers (1)

artless-noise-bye-due2AI
artless-noise-bye-due2AI

Reputation: 22420

The leading 'arm-none-eabi' is the type of compiler. This is known as the tuple and is specified as a configure 'prefix'. Many of the binaries may be links or short wrapper scripts that call another binary (gcc). Also some of the names are just in case you have existing system binaries with the same name or multiple gcc installs.

You can find this information by running a man command on the program name. Briefly,

  • addr2line - convert an address (hex) to a code line number.
  • ar - a static library (or archive) tool.
  • as - an assembler
  • c++ - the C++ front-end
  • c++filt - convert a mangled name to function with prototypes.
  • cpp - the preprocessor only.
  • elfedit - elf header manipulation.
  • g++ - C++ with gnu extensions.
  • gcc - standard binary (given options can do the same as wrappers).
  • gcc-5.4.1 - full name for system with multiple GCC installs.
  • gcc-ar - rename in case of multiple 'ar'.
  • gcc-nm - rename in case of multiple 'nm'.
  • gcc-ranlib - rename in case of multiple 'ranlib'.
  • gcov - code coverage
  • gcov-tool - code coverage
  • gdb - the debugger
  • gdb-py - more minimal debugger
  • gprof - call graph/profiler.
  • ld - the linker (most likely gold).
  • ld.bfd - an older style linker with a few more features; MUCH slower for large C++ projects.
  • nm - display 'names' in a binary.
  • objcopy - manipulate a binary (sections).
  • objdump - information on a binary.
  • ranlib - generate a library index.
  • readelf - information on ELF binaries.
  • size - program section sizes
  • strings - dump all strings in a binary.
  • strip - remove debug information from a binary.

As a concept, the name 'gcc-ar' and 'ar' are physically the same thing. However, another 'ar' may exist in the path (a Solaris, or other Unix system) and the 'gcc-ar' name can be used to get the gcc specific 'ar'; all the 'gcc-XXX' things are for this use case.

Upvotes: 6

Related Questions