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]

linker issue (a.out is not running.)



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




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