Compilation Process
Abdallah Ghazy
Student in Computer Engineering | Embedded Systems & Robotics Enthusiast | Future Expert in ADAS and Autonomous Vehicles
Preprocessing:
gcc -E example.c -o example.i
Compilation:
gcc -E example.c -o example.i
Assembly:
gcc -S example.c -o example.s
Relocatable object files
contain processor architecture-specific machine code with no absolute addresses, allowing for flexible placement in memory during the linking process. They enable the generation of executable files by allowing the linker to adjust addresses and resolve symbols according to the final memory layout of the program.
Linking:
gcc example.c -o example
Additional Details
领英推荐
Intermediate Files: During the compilation process, various intermediate files are generated:
?Linking Libraries: The linker can link against standard libraries (like the C standard library) and custom libraries.
Compiler Flags
Compiler Flags: Various flags can be used to control the compilation process:
?table of key gcc flags :
?
?
?
?
?