Cannot find entry symbol _start

Joel Sherrill joel.sherrill at oarcorp.com
Fri Jun 8 13:07:54 UTC 2007


Feng Wang wrote:
> Hi, all
>
> I'm a newbie to rtems and want to build toolset for sparc target from
> source codes. As rtems 4.6.5 on-line documents say,  I download souce
> codes, patch diff files, configure, make and install. All are
> successful. But when I used the installed compiler, got a warning
> "cannot find entry symbol _start" and link error "undefined reference
> to `_exit'"
>
> Do I miss something?
>
>
>   
RTEMS is a run-time library that you link with your code to get
(in this case) a statically linked executable.  I see no indication that
you compiled, configured or linked with RTEMS. 

See http://www.rtems.org/wiki/index.php/Quick_Start
Build RTEMS and you should have an executable you can run.
Remember the sis BSP is for the erc32 simulator in gdb and
erc32 is for real hardware or tsim.

Why did you go with RTEMS 4.6.5 and not 4.6.6 or even better 4.7?

And if you are on Redhat 9, why didn't you just use our RPMs?

--joel
> My host platform is Red Hat Linux release 9 (Shrike) Kernel 2.4.20-8
> on an i686. Host compiler is gcc version 3.2.2 20030222 (Red Hat Linux
> 3.2.2-5)
>
> I installed the toolset to /opt/rtems-4.6. An example is followed.
>
> Any help will be appreciated. TIA.
>
> [wf at WFPC wf]$ cat a.c
> #include <stdio.h>
> #include <stdlib.h>
>
> int
> main ()
> {
>  printf("Hello world\n");
>  exit (0);
>  return 0;
> }
>
> [wf at WFPC wf]$ /opt/rtems-4.6/bin/sparc-rtems-gcc  a.c
> /opt/rtems-4.6/lib/gcc-lib/sparc-rtems/3.2.3/../../../../sparc-rtems/bin/ld:
> warning: cannot find entry symbol _start; defaulting to 00010074
> /opt/rtems-4.6/lib/gcc-lib/sparc-rtems/3.2.3/../../../../sparc-rtems/lib/libc.a(exit.o):
> In function `exit':
> /home/wf/rtems/b-gcc/sparc-rtems/newlib/libc/stdlib/../../../../../gcc-3.2.3/newlib/libc/stdlib/exit.c:80:
> undefined reference to `_exit'
> collect2: ld returned 1 exit status
> [wf at WFPC wf]$ /opt/rtems-4.6/bin/sparc-rtems-gcc -v
> Reading specs from /opt/rtems-4.6/lib/gcc-lib/sparc-rtems/3.2.3/specs
> Configured with: ../gcc-3.2.3/configure --build=i686-pc-linux-gnu
> --host=i686-pc-linux-gnu --target=sparc-rtems --with-gnu-as
> --with-gnu-ld --with-newlib --verbose --with-system-zlib --disable-nls
> --enable-version-specific-runtime-libs --enable-threads=rtems
> --prefix=/opt/rtems-4.6 --enable-languages=c
> Thread model: rtems
> gcc version 3.2.3
>
> Best Regards,
> Feng Wang
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list