Tool chain software includes Binutils, GCC, GLIBC, GDB and so on.
Binutils is a tool for Binary program processing tools, including linker, assembler and other target program processing tools.
GCC (GNU Compiler Collection) is a compiler. Support for the GLIBC library is required for full support of C + + languages.
GLIBC is an application-programmed library package that compiles static and shared libraries. The full GCC needs to support glibc.
GDB is a debugging tool, can read the executable program in the symbol table, the program to debug the source code.
By default, the GNU compiler generates a target file format of elf format.
The Elf file consists of several segments (sections).
C:.text (body segment) contains the program's instruction code
. Data (segment) contains fixed data, as usual, string
. BSS (uninitialized data segment) uninitialized variables, arrays, and so on.
C++:.fini (destructor code)
. Init (constructor code)
The elf format files generated by the link cannot be downloaded directly to the target platform, and the final binaries can be generated via the Objcopy tool.
The linker's task is to connect the. Text,. Data,. BSS segments of multiple destination files together, and the connection script tells the linker where to start placing the segments.
1. Binutils
The target code (*.O) generated by the assembler (as) cannot be run directly on the computer, it must be handled by the linker (LD) to generate executable code.
#ld –s–o Test TEST.O
2. Add2line
Converts an address to a file name or line number pair so that the debugger
3. AR Create, modify, and extend files from a file
4. GASP Assembly Macro processor
5. NM Enumerate all variables from the target file
6. Objcopy using the GNU BSD Library
Copies the contents of the target file from one file format to the target file in another format.
7. objdump Display target file information
You can compile binary files, disassemble the object files, and view machine code.
8. readelf Display elf file information
9. Ranlib generates an index to expedite access to the archive file and save it to this archive.
Size lists the code size of the target module or file.
strings print a printable target code symbol (at least 4 characters)
Strip discard all symbolic connections, the general application will eventually have to strip processing
C++FILT linker LD uses this command to filter C + + symbols and Java symbols to prevent overloaded function collisions.
GPROF displays various data for the program call segment
Overview of the GCC tool chain