qustion@jeff-debian:~/Samsung/hello/printf$ cat -b ./hello.c
1 #include
2 int main(int argc, char *argv[]) {
3 int i=0;
4 for(i=0;i<10000000;i++){
5 printf("hello world\n");
6 }
7 return 0;
8 }
qustion@jeff-debian:~/Samsung/hello/printf$ gcc -O0 -o hello hello.c
qustion@jeff-debian:~/Samsung/hello/printf$ nm --undefined-only ./hello
w _Jv_RegisterClasses
w __gmon_start__
U __libc_start_main@@GLIBC_2.0
U puts@@GLIBC_2.0
qustion@jeff-debian:~/Samsung/hello/printf$ time ./hello > /dev/null
real 0m0.699s
user 0m0.692s
sys 0m0.004s
qustion@jeff-debian:~/Samsung/hello/printf$
qustion@jeff-debian:~/Samsung/hello/printf$ gcc -O0 -fno-builtin-printf -o hello hello.c
qustion@jeff-debian:~/Samsung/hello/printf$ nm --undefined-only ./hello
w _Jv_RegisterClasses
w __gmon_start__
U __libc_start_main@@GLIBC_2.0
U printf@@GLIBC_2.0
qustion@jeff-debian:~/Samsung/hello/printf$ time ./hello > /dev/null
real 0m0.890s
user 0m0.880s
sys 0m0.008s
qustion@jeff-debian:~/Samsung/hello/printf$
reference:http://www.ciselant.de/projects/gcc_printf/gcc_printf.html
沒有留言:
張貼留言