When a C program is compiled with GCC's -static option on, the final executable file would include tons of C's standard functions. For example, my whole program is like
int main(int argc, char *argv[]) {
printf("Hello, world!\n");
return 0;
}
I checked the compiled executable file, and functions like, strcmp(), mktime(), realloc(), etc. are included in it, even though my program never calls them. However, some functions in stdlib.h are missing, like, rand(), system(), etc. My experiment environments are: Ubuntu 14.04 (with Linux kernel 3.13.0); GCC 4.8.2. I would like to know which C's functions would be included in the executable file when -static is turned on.