-E = Stop after the preprocessing stage. the output is form of preprocessed soruce code.
-S = Stop after the stage of compilation proper. don't assemble. form of an assembler code file for each non-assembler input file specified. basically just do compilation
-c = Compile or assemble the source files, but don't link. output is form of an object file for each source file.
-ggdb = Produce debugging information for use by GDB.
we need to link printf.o file with our hello.o file. libc.a is dynamic library.
notice size is much smaller on dynamicexe. it don't contain code of printf.o. to execute with dynamic library system must have specific library.
ELF format
it is a format for storing programs or fragments of programs on disk, created as a result of compiling and linking.
An executable file using the ELF format consist of ELF Header , Program Header Table an Section Header Table.
- Relocatable file ojbects (.o)
- Normal excutabl efiles (a.out)
- Shared object files (.so)
Magic number act as file extension telling OS this is a certain format.
16 general purpose registers , rip== instruction pointer , segment registers.
with "info all-registers" command we can see rest of registers.
psuedo code for statring executable file.
executing systemcall using syscall , no wrapper function and with assembly code.
'Operating System > System Programming(Arif Butt)' 카테고리의 다른 글
Lec 6, 7) Versioning Systems git-1,2 (0) | 2021.06.15 |
---|---|
Lec05) GNU autotools and cmake (0) | 2021.06.13 |
Lec04) UNIX make utility (0) | 2021.06.12 |
Lec03) Working of Linkers: Creating your own Libraries (0) | 2021.06.11 |
Lec1) Introduction to System Programming (0) | 2021.06.08 |