Take the following program C:
int main(){}
It does not use anything from the C standard library.I suggested that we can disconnect communication through - nostdlib .
However, this results in the following error:
$ gcc -nostdlib -o main main.c /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400150
Can someone clarify what is a symbol _startand who is responsible for providing it?How can i use it -nostdlib?
_start
-nostdlib
In the docs, I also tried:
$ gcc -nostdlib -o main main.c -lgcc
The same behavior is observed with clang.
_start - , . . libc , , , main. , libc, C- .
main
libc, _start. , , , . - libc, , _exit.
_exit