I want to static link libray which I included (such as stdio) with gcc, so I use the -static options.
My environment is ubuntu 10.10.
gcc version is 4.4.5.
the compile command I used is : gcc -static -o output.out input.c
the following is my source code.
include
int main(){
After I compile it and use the -static option, I objdump the executable file.
printf("hello world");
return 0;
}
and I found out that the printf is actually called _IO_printf.
And I write another program, the following is the souce code.
include
int main(){
I compile this source code with the same option and objdump the new executable file.
return 0;
}
However, I can't find the _IO_printf.
My question is why I can't fine _IO_printf in the second case. I have static linked the libray which I included.
Can someone plz help me solve this problem, thx.