How to use -nostdlib?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried the following commands which are supposed to work, but didn't.
Does anybody know what is wrong? Thanks.

https://blogs.oracle.com/ksplice/entry/hello_from_a_libc_free

$ cat test.c
#include <stdio.h>
int main() {
  printf("Hello World\n");
}
$ gcc -nostdlib -o test_nostdlib test.c
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to
0000000000400144
/tmp/ccZBi5G9.o: In function `main':
test.c:(.text+0xa): undefined reference to `puts'
collect2: error: ld returned 1 exit status

-- 
Regards,
Peng




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux