Re: pushl %ebp - popl %ebp - ret (Returning seg fault)



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


.