This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linking Problem..


On Thursday 04 October 2001 01:17, you wrote:
> > > 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
>
Hello,
	It appears your linker script does not match your crt0.o file. If calling 
from gcc use the -Wl,-T<script.ld> option. Just replace <script.ld> with the 
name of your script. You can also specify your linker script in the gcc specs 
file:

*link:
-T<your linker script>%s

Also in specs, verify:

*lib:
-lc -l<your libgloss library> -lc

*libgcc:
-lgcc

Hope this helps,
Larry Gray

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

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]