public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* linker issue (a.out is not running.)
@ 1999-11-25 10:50 Hsien-Hsin Lee
  1999-11-25 15:58 ` Juergen Heinzl
  1999-11-30 23:28 ` Hsien-Hsin Lee
  0 siblings, 2 replies; 4+ messages in thread
From: Hsien-Hsin Lee @ 1999-11-25 10:50 UTC (permalink / raw)
  To: help-gcc

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 

LEVEL 0 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 1 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 2 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 0 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 1 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 2 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60
[ 93 ] tmp -: file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically
linked (uses shared libs), not stripped

Thanks,
	- HH Lee



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linker issue (a.out is not running.)
  1999-11-25 10:50 linker issue (a.out is not running.) Hsien-Hsin Lee
@ 1999-11-25 15:58 ` Juergen Heinzl
  1999-11-30 23:28   ` Juergen Heinzl
  1999-11-30 23:28 ` Hsien-Hsin Lee
  1 sibling, 1 reply; 4+ messages in thread
From: Juergen Heinzl @ 1999-11-25 15:58 UTC (permalink / raw)
  To: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]

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 /

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linker issue (a.out is not running.)
  1999-11-25 15:58 ` Juergen Heinzl
@ 1999-11-30 23:28   ` Juergen Heinzl
  0 siblings, 0 replies; 4+ messages in thread
From: Juergen Heinzl @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]

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 /

^ permalink raw reply	[flat|nested] 4+ messages in thread

* linker issue (a.out is not running.)
  1999-11-25 10:50 linker issue (a.out is not running.) Hsien-Hsin Lee
  1999-11-25 15:58 ` Juergen Heinzl
@ 1999-11-30 23:28 ` Hsien-Hsin Lee
  1 sibling, 0 replies; 4+ messages in thread
From: Hsien-Hsin Lee @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

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 

LEVEL 0 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 1 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 2 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 0 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 1 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60 
LEVEL 2 : ADDR= 0 ADDR= 10 ADDR= 20 ADDR= 40 ADDR= 50 ADDR= 60
[ 93 ] tmp -: file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically
linked (uses shared libs), not stripped

Thanks,
	- HH Lee



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-11-30 23:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-25 10:50 linker issue (a.out is not running.) Hsien-Hsin Lee
1999-11-25 15:58 ` Juergen Heinzl
1999-11-30 23:28   ` Juergen Heinzl
1999-11-30 23:28 ` Hsien-Hsin Lee

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).