Re: pushl %ebp - popl %ebp - ret (Returning seg fault)
- From: Frank Kotler <spamtrap@xxxxxxxxxx>
- Date: Sat, 25 Mar 2006 03:08:58 -0500
skylazart wrote:
.....
.text
.globl _start
_start:
This label is jumped to, not called, so there's no return address on your stack. First thing on the stack is the argument count.
addl $1060, %esp
popl %ebp
ret # <--- Here is the problem (Its crashing)
Nowhere to return to!
## _exit(0)
movl $SYS_exit,%eax
xorl %ebx, %ebx
int $0x80
Exit like this instead, and I think you'll be fine.
Best,
Frank
.
- Follow-Ups:
- Re: pushl %ebp - popl %ebp - ret (Returning seg fault)
- From: skylazart
- Re: pushl %ebp - popl %ebp - ret (Returning seg fault)
- From: Claudio Daffra
- Re: pushl %ebp - popl %ebp - ret (Returning seg fault)
- References:
- pushl %ebp - popl %ebp - ret (Returning seg fault)
- From: skylazart
- pushl %ebp - popl %ebp - ret (Returning seg fault)
- Prev by Date: pushl %ebp - popl %ebp - ret (Returning seg fault)
- Next by Date: Re: pushl %ebp - popl %ebp - ret (Returning seg fault)
- Previous by thread: pushl %ebp - popl %ebp - ret (Returning seg fault)
- Next by thread: Re: pushl %ebp - popl %ebp - ret (Returning seg fault)
- Index(es):