Lab3
Compiled C Lab Let's start by writing the hello world. then with this saved we can run the compiler with the Flags specified gcc -g -O0 -fno-builtin hello.c Looking at the objdump header file for our program Objdump -f We see that: Were using an x86 platform File Format is in ELF ( Executable and Linkable Format) We can look at the specific selections of this output file by using objdump with -d flag which disassemble sections containing code Objdump -d This is our main! We can see the function call to printf with callq on line 5. The argument was moved into the register on line 4. - Static gcc -g -O0 -fno-builtin -static hello.c -o hellostatic objdump -s hellostatic The file was huge, when read wouldn't fit in the whole window! This is due to the .static flag. It causes the libraries to be included in the executable because it prevents dynamic l
Comments
Post a Comment