0

When compiling the code below with

gcc -nostdlib main.cpp

I get the following error

/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000001000

I don't understand why the linker can find my _start function. I've seen examples online where people seem to be defining _start like below or defining it in assembly. What am I missing?

main.cpp:

int main() {
   return 0;
}

void _start()
{
   main();
}

0 Answers0