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: gcc-m68k cross compiler problem gcc2.95.2


Thanks Mike,
It worked.

But now i have written a sample program to test this.

#include <stdio.h>

int main( void )
{
	printf("\nHello World");
	return 0;
}

When i compile the program  using "m68k-coff-gcc hello.c".
But i got the error as below.

[root@Linux-Test sample]# ../bin/m68k-coff-gcc test.c
/home/kc/gnu-tools/m68k-coff/lib/crt0.o:../../../../newlib-1.8.2/libgloss/m6
8k/c
rt0.S:16: undefined reference to `hardware_init_hook'
/home/kc/gnu-tools/m68k-coff/lib/crt0.o(.text+0x48):../../../../newlib-1.8.2
/lib
gloss/m68k/crt0.S: undefined reference to `software_init_hook'
/home/kc/gnu-tools/m68k-coff/lib/crt0.o(.text+0x58):../../../../newlib-1.8.2
/lib
gloss/m68k/crt0.S: undefined reference to `__FINI_SECTION__'
/home/kc/gnu-tools/m68k-coff/lib/crt0.o(.text+0x5e):../../../../newlib-1.8.2
/lib
gloss/m68k/crt0.S: undefined reference to `atexit'
/home/kc/gnu-tools/m68k-coff/lib/crt0.o(.text+0x64):../../../../newlib-1.8.2
/lib
gloss/m68k/crt0.S: undefined reference to `__INIT_SECTION__'
/tmp/ccTN1ZK5.o(.text+0x1e):test.c: undefined reference to `printf'
/home/kc/gnu-tools/lib/gcc-lib/m68k-coff/2.95.2/libgcc.a(_exit.o): In
function `
exit':
/home/kc/build-gcc/gcc/../../gcc-2.95.2/gcc/libgcc2.c(.text+0x12): undefined
ref
erence to `_cleanup'
/home/kc/build-gcc/gcc/../../gcc-2.95.2/gcc/libgcc2.c(.text+0x1a): undefined
ref
erence to `_exit'
collect2: ld returned 1 exit status


What i did was, i wrote a linker script by using the example script. At that
point the entry point is not a main(). I got the appropriate executable.

Can some body tell me how to work around the above problems ?.

I think if i execute gcc to get me the final executable file, the gcc will
intern call pre-processor, c-compiler, assembler and then linker. I think
the linker may not be getting correct linker script or the above definitions
such as (hardware_init_hook etc) are not there in the linker script which ld
is looking for.

Am i correct ?

Thanks for any help,

With best regards,

\/ \/   Mahadev K. Cholachagudda
O . O   mailto:kcmahadev@zilogindia.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]