This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Warning of "ld"
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: Arash Razmjoo <a-razmjoo at hotmail dot com>, binutils at sources dot redhat dot com
- Date: Sun, 27 May 2007 17:45:50 -0400
- Subject: Re: Warning of "ld"
- References: <BAY139-F6620ED41EE38A6566630FED290@phx.gbl>
On Mon, May 28, 2007 at 12:56:28AM +0430, Arash Razmjoo wrote:
>Hello developers
>I wrought a single program in C,compiled it with gcc 3.2.2 20030222 with
>this command:
>
> gcc -c test4.c
>
>and "gcc" gave me an object file "test4.o" without any messages.Then I
>tried to link it with ld 2.13.90.0.18 with this instruction:
>
>ld test4.o -lc -o test4
>
>but "ld" has gave me this message:
>
>ld: Warning: cannot find entry symbol _start; defaulting to 08048184
>
>When i tried to run "test4",this message appeard:
>
>bash2: /home/.../test4: usr/lib/libc.so.1: bad ELF interpreter: No such
>file or directory
>
>Now please tell me it is caused by "gcc" or "ld" ?
You need to use gcc to link your final program:
gcc -o test4 test4.o
Don't use ld directly unless you really know what you're doing.