Ch4: Building Flashcards

(7 cards)

1
Q

What are the three steps of the compilation process

A
  1. preprocessing
  2. assembly code creation (compiling)
  3. machine code creation (assembling)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens during preprocessing

A
  • goes thru each .c source file
  • does text substitutions/other things necessary for compiling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What happens during assembly code creation (compiling)

A
  • compiler translates code into assembly code
  • code is optimized in this stage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens during machine code creation

A
  • take assembly code and assemble it into machine code (.o files)
  • machine code send commands to CPU directly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens during linking

A
  • object files are linked tgt to form final executable
  • resolves external function addresses
  • lets code use library functions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the gcc commands for assembling and linking

A

gcc -c generates object files
gcc -o to link .o files (machine code)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the first two lines of a makefile

A

1st line indicates dependencies, all object files that need to be compiled
2st line builds executable by linking the necessary .o files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly