pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pgubook-readers] exit program segmentation fault


From: Graeme Stewart
Subject: Re: [Pgubook-readers] exit program segmentation fault
Date: Fri, 12 Aug 2005 10:53:12 -0700

Richard,
 
I copied your code, assembled, linked, and ran it - no problem.
 
I can re-create a similar problem when the global symbol "_start" doesn't match, an error example would be:
 
.globl _start
start:
 
Error is "ld: warning: cannot find entry symbol _start; defaulting to 08048074"
 
Can you provide some additional information on the Linux version your running, processor type etc? Maybe it's a specific module your missing?
 
Good luck,
 
Graeme

 
On 8/12/05, Richard Wright <address@hidden> wrote:
Still cannot get past what is wrong with the exit program:

#as
.section .data
.section .text
.globl _start
_start:
movl $1, %eax
movl $0, %ebx
int $0x80

as exit.s -o exit.o
#ld exit.o -o exit
"Cannot find entry symbol _start;" (Try line 4!)
#./exit
"segmentation fault"

I have tried altering the spaces and indentations. The same error message
keeps coming up. I read a thread where someone else had a similar problem on
linuxassembly.org . He solved it by changing from capitals to lower case.
Mine is written in lower case anyway, but just to be sure I tried doing it
with capitals and again in lower case. Still got the same response. I have
experimented by putting the last two commands either in the shell or in the
assembler. That just confuses it as to where the exit.s file is. Since the
error message was returning _start with a semi colon I tried entering it in
with a semi colon. Still the same response. I wondered about the kernal
command $0x80. I'm using the letter x, but I wonder if it should be the
multiplication symbol, but if that were the case it should be $0*80 on my
computer as I'm sure it is on anyone elses machine. Tried it anyway, still
no luck. After entering

echo $?

it responded

139
I have re-read the chapter over and over and I can't think what's wrong. I'm
entering it exactly as it's written.

any help will be greatly appreciated.

Rick




_______________________________________________
Pgubook-readers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/pgubook-readers


reply via email to

[Prev in Thread] Current Thread [Next in Thread]