From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mahadev K Cholachagudda" To: Subject: RE: gcc-m68k cross compiler problem gcc2.95.2 Date: Fri, 12 Jan 2001 04:04:00 -0000 Message-id: References: <003a01c07c65$c3469da0$9e0150c0@penbex.com.tw> X-SW-Source: 2001-01/msg00095.html Thanks Mike, It worked. But now i have written a sample program to test this. #include 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mahadev K Cholachagudda" To: Subject: RE: gcc-m68k cross compiler problem gcc2.95.2 Date: Sun, 01 Apr 2001 00:00:00 -0000 Message-ID: References: <003a01c07c65$c3469da0$9e0150c0@penbex.com.tw> X-SW-Source: 2001-q1/msg00095.html Message-ID: <20010401000000.uYM1q-Tkih8963lD3vR6l6DwEIr_uMEbTILAVSbn3Mo@z> Thanks Mike, It worked. But now i have written a sample program to test this. #include 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