Binutils - Linux Embedded systems

The first project to build is binutils, which supplies common routines for handling Executable and Linkable Format (ELF) based executable files. ELF is the format that Linux uses for binary executable files. The GCC compiler relies on binutils to provide much of the platform-specific functionality. Binutils provides the following utilities:

  • as: The Gnu assembler. Transforms mnemonic assembler code into opcodes for the target processor.
  • ld: The linker. It takes as input a group of object files and creates a binary file such as an executable or shared library or other object file. The linker lays out the file in its final format.
  • ar: The archive program that packages a group of object files into a single library file to make using the object files more convenient.
  • objdump: Prints out the contents of an ELF file. Can be used as a disassembler.
  • objcopy: Makes a copy of an ELF file, allowing you to control what is copied in ELF terms, such as selecting certain sections of the file or removing debugging symbols.
  • c++filt: Demangles a C++ symbol. The compiler generates internal symbols to handle classes, namespaces, and overloaded functions; this undoes the process to make finding problems in source code easier.
  • size: Prints the size of sections in the file. This is an important tool that’s used when minimizing a system’s size.
  • strings: Prints the null-terminated string constants in a program.
  • strip: Removes debugging and other bookkeeping information.

Building binutils is a nice place to begin building a toolchain, because it’s very straightforward and rarely fails.

Building binutils

Build-Values and their explanations

The configure script runs and produces output showing what it’s inspecting. When it’s complete, run the make:

$ cd $BUILDDIR/binutils $ make

The software builds; this takes about 20 minutes on a typical machine. When the build completes, put the newly built binutils in the installation directory:

$ make install

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Linux Embedded systems Topics