Because time() and some other functions are builtin defined in the C library (libc) itself and GCC always links to libc unless you use the -ffreestanding-ffreestanding compile option. However math functions live in libm which is not implicitly linked by gcc.