I am trying to get the raw instruction code output for a simple C program with function calls.
I have already searched on here and Google for the answer but can only find answers that are correct for single functions (no function calls).
A trivial example:
int main(){
return addition(5, 7);
}
int addition(int a, int b){
return a + b;
}
When I use gcc -c test.c -o test.o
and then objdump -d test.o
on this, the JAL
(jump and link) instruction shows a jump to address 0x00000000
which is obviously incorrect, however when I compile the program fully, I get an enormous amount of junk in the objdump
command
I am compiling with the mips compiler (and associated mips-objdump, etc).
The programs I am compiling are self contained (no external libraries, or system include files). What I want is a dump of the instructions where the JAL
and equivalent instructions point to the correct addresses for the functions they call.