public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: "Mahadev K Cholachagudda" <kcmahadev@zilogindia.com>
To: <crossgcc@sources.redhat.com>
Subject: RE: gcc-m68k cross compiler problem gcc2.95.2
Date: Fri, 12 Jan 2001 04:04:00 -0000	[thread overview]
Message-ID: <NEBBJIKLHKODECFJDDFGMEGNCDAA.kcmahadev@zilogindia.com> (raw)
In-Reply-To: <003a01c07c65$c3469da0$9e0150c0@penbex.com.tw>

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

WARNING: multiple messages have this Message-ID
From: "Mahadev K Cholachagudda" <kcmahadev@zilogindia.com>
To: <crossgcc@sources.redhat.com>
Subject: RE: gcc-m68k cross compiler problem gcc2.95.2
Date: Sun, 01 Apr 2001 00:00:00 -0000	[thread overview]
Message-ID: <NEBBJIKLHKODECFJDDFGMEGNCDAA.kcmahadev@zilogindia.com> (raw)
Message-ID: <20010401000000.uYM1q-Tkih8963lD3vR6l6DwEIr_uMEbTILAVSbn3Mo@z> (raw)
In-Reply-To: <003a01c07c65$c3469da0$9e0150c0@penbex.com.tw>

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

  reply	other threads:[~2001-01-12  4:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-11 21:46 FW: Mahadev K Cholachagudda
2001-01-11 23:09 ` mike
2001-01-12  4:04   ` Mahadev K Cholachagudda [this message]
2001-01-12  5:38     ` gcc-m68k cross compiler problem gcc2.95.2 Pierre Saucourt-Harmel (r54698)
2001-01-12 22:54       ` Mahadev K Cholachagudda
2001-04-01  0:00         ` Mahadev K Cholachagudda
2001-04-01  0:00       ` Pierre Saucourt-Harmel (r54698)
2001-04-01  0:00     ` Mahadev K Cholachagudda
2001-04-01  0:00   ` mike
2001-04-01  0:00 ` FW: Mahadev K Cholachagudda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=NEBBJIKLHKODECFJDDFGMEGNCDAA.kcmahadev@zilogindia.com \
    --to=kcmahadev@zilogindia.com \
    --cc=crossgcc@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).