lkml.org 
[lkml]   [2006]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Segfault on the i386 enter instruction
Date
On Friday 12 May 2006 17:07, linux-os (Dick Johnson) wrote:
> > .file "a.c"
> > .version "01.01"
> > gcc2_compiled.:
> > .section .rodata
> > .LC0:
> > .string "asdf\n"
> > .text
> > .align 4
> > .globl main
> > .type main,@function
> > main:
> > enter $10008, $0
> > # pushl %ebp
> > # movl %esp,%ebp
> > # subl $10008,%esp
> > addl $-12,%esp
> ^^^^^^^^^^^^^^____________ WTF
> adding a negative number is subtracting that positive value.
> You just subtracted 0xfffffff3 (on a 32-bit machine) from
> the stack pointer. It damn-well better seg-fault!

No. Try it yourself.
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-12 16:23    [W:0.047 / U:2.440 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site