Real-Time Systems Development

Gcc by itself only compiles the C or C++ code into assembler. Normally gcc assumes responsibility for invoking all the passes required for a complete build. These are: cpp, cc1, gas, and ld. Where cpp is the C preprocessor, which merges all the required include files, expands all macro definitions, and processes all the #ifdef conditional sections. To see the output of ccp, invoke gcc with the -E option, and the preprocessed file will be displayed. The actual compiler is cc1, which produces assembler code from the preprocessed source file. In fact, gcc is really only a driver program to evoke all the compiler passes. Although it is seen as a compiler command line, gcc will deal with command-line options intended for any of the other passes. The usual gcc command line will ask ld to link in the necessary startup code and additional libraries by default.
GNU gas started its life as a single phase within the compiling operation, but now it can also be used as a stand-alone, source-level assembler. When used as a source-level assembler, it has a companion assembler preprocessor called gasp. This has a syntax similar to most other assembler macro packages. Gas generates a relocatable object file from the assembler source.
The linker, ld, is responsible for resolving the values of logical symbols and addresses, swapping numbers for the symbols, by using the symbol table. Some RTEs use relocatable object file formats like...