This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: linker issue (a.out is not running.)


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 /


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]