

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of the process of creating executables from c source code, focusing on the roles of the preprocessor, compiler, linker, and different executable formats. It covers static and dynamic linking, archives, libraries, and shared objects.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Based on slides by Jonathan Misurda
.c cpp^ cc1^ .o ld C source Preprocessor (^) Compiler Preprocessed source Linker Object files (^) Executable gcc
#define PI 3. #define BUFSIZE 1024 char buffer[BUFSIZE]; char buffer2[BUFSIZE + 16];
struct exec { unsigned long a_midmag; //magic number unsigned long a_text; unsigned long a_data; unsigned long a_bss; unsigned long a_syms; unsigned long a_entry; unsigned long a_trsize; unsigned long a_drsize; };
Stack Data (Heap) Text (Code) 0x7fffffff 0 Data (Heap) CS 1550 - 2077 _end Data (Globals) brk $sp brk