Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find entry symbol _start

Tags:

gcc

My c code on compiling on gcc is giving the error Cannot find entry symbol _start defaulting to 00000. Can anyone tell me why and how to correct it?

The command line is arm-none-eabi-gcc -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp file path and the target platform is a-8 sitara cortex processor.

like image 937
Prachi Chouksey Avatar asked Jun 12 '12 10:06

Prachi Chouksey


2 Answers

The only reason the compiler threw the above error is because the start code(_start function) generated by the OS for running your code cannot find the default or registered function main. So either you can use _start function instead of main function but the compilation command should be gcc -nostartfiles filename.c but using _start there are a lot of exceptions so better to use main instead.

like image 164
pravu pp Avatar answered Oct 20 '22 00:10

pravu pp


the -none- part means that your toolchain doesn't build for a particular operating system, so you must define a _start entry point. For non-bare-metal toolchains that build for a particular operating system, _start is provided by the standard library that in order will call main when everything is set up.

like image 40
Giuseppe Scrivano Avatar answered Oct 19 '22 22:10

Giuseppe Scrivano