Linking Problem..

Surya Prakash suryaprakash@multitech.co.in
Wed Oct 3 22:12:00 GMT 2001


> > Am I need to do it
> > explicitly in the linker command ?
>
> Only if you use ld for linking.  If you use gcc, it would implicitly
> link in libgcc, the C run-time object files and the C library, which
> is what you  like to do.

If I use just gcc without '-c' switch , I am getting the following
errors.

/usr/local/m68k-coff/lib/crt0.o:/src/newlib-1.9.0/libgloss/m68k/crt0.S:16:
undefined reference to 'hardware_init_hook'
/usr/local/m68k-coff/lib/crt0.o(.text+0x48):/src/newlib-1.9.0/libgloss/m68k/crt0.S:
undefined reference to 'software_init_hook'
/usr/local/m68k-coff/lib/crt0.o(.text+0x58):/src/newlib-1.9.0/libgloss/m68k/crt0.S:
undefined reference to '__FINI_SECTION__'
/usr/local/m68k-coff/lib/crt0.o(.text+0x5e):/src/newlib-1.9.0/libgloss/m68k/crt0.S:
undefined reference to 'atexit'
/usr/local/m68k-coff/lib/crt0.o(.text+0x64):/src/newlib-1.9.0/libgloss/m68k/crt0.S:
undefined reference to '__INIT_SECTION__'
/tmp/ccMRkff.o(.text+0x48c):surya.c: undefined reference to 'memcpy'
/usr/local/lib/gcc-lib/m68k-coff/2.95.2/libgcc.a(_exit.o):In function
'exit' :
/src/gcc-2.95.2/gcc/libgcc2.c(.text+0x12): undefined reference to
'_cleanup'
/src/gcc-2.95.2/gcc/libgcc2.c(.text+0x1a): undefined reference to '_exit'

collect2: ld returned 1 exit status


/src is the directory where I extracted the sources.  Am I missing any
script files?? What could cause these errors to creep in?
Somebody could suggest me how to get rid of these errors ?

Regards
Surya




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list