This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: linker issue (a.out is not running.)
- To: help-gcc at gnu dot org
- Subject: Re: linker issue (a.out is not running.)
- From: juergen at monocerus dot demon dot co dot uk (Juergen Heinzl)
- Date: Thu, 25 Nov 1999 23:54:58 GMT
- Newsgroups: gnu.gcc.help
- Organization: Rent A Bug Ltd
- References: <Pine.LNX.4.10.9911251329570.6867-100000@willamette.eecs.umich.edu>
- Xref: wodc7nx0 gnu.gcc.help:1967
In article <Pine.LNX.4.10.9911251329570.6867-100000@willamette.eecs.umich.edu>, Hsien-Hsin Lee wrote:
>
>Can anyone help me explaining why the binary (on my linux box) generated
>by the following command sequence is not working ? Might be my linker
>command is incorrect ? (I thought some of previous posts have the similar
>issue.) or the object file containing _start (crt1.o) is wrong ?
>
>[ 84 ] tmp -: gcc -S x.c
>[ 85 ] tmp -: as -o x.o x.s
>[ 86 ] tmp -: ld -o a.out /usr/lib/crt1.o x.o -lc
>[ 87 ] tmp -: ./a.out
>./a.out: Command not found.
>[ 90 ] tmp -: file a.out
>a.out: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically
>linked (uses shared libs), not stripped
>
>
>While this is working...
>
>[ 91 ] tmp -: gcc x.c
>[ 92 ] tmp -: ./a.out
Try gcc -v -Wl,-v to see what is linked in as crt1.o is not enough,
especially if shared libraries and the standard libc are required.
[...]
Cheers,
Juergen
--
\ Real name : Jürgen Heinzl \ no flames /
\ EMail Private : juergen@monocerus.demon.co.uk \ send money instead /