#include <stdio.h>
void main() {
printf("Hello World!\n");
}
$ gcc code.c
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
$ gcc code.c
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
$ gcc code.c
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
$ ./a.out
Hello World!
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Compiler
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Compiler
Assembly code
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Compiler
Assembly code
Assembler
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Compiler
Assembly code
Assembler
Object code
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Compiler
Assembly code
Assembler
Object code
Linker
Libraries
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
Compiler
Assembly code
Assembler
Object code
Linker
Libraries
Executable
Preprocessor
#include <stdio.h>
void main() {
printf("Hello World!\n");
}
/*
actual code of
the <stdio.h> header
*/
void main() {
printf("Hello World!\n");
}
Compiler
/*
actual code of
the <stdio.h> header
*/
void main() {
printf("Hello World!\n");
}
.file "code.c"
.text
.section .rodata
.LC0:
.string "Hello World!"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
leaq .LC0(%rip), %rdi
call puts@PLT
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
Assembler
.file "code.c"
.text
.section .rodata
.LC0:
.string "Hello World!"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
leaq .LC0(%rip), %rdi
call puts@PLT
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
Linker
Libraries
Hello World!
Thank you for your attention.