Messages in this thread | | | Date | Thu, 19 Sep 2002 11:57:47 -0700 | From | Richard Henderson <> | Subject | Re: Syscall changes registers beyond %eax, on linux-i386 |
| |
On Thu, Sep 19, 2002 at 02:51:44PM -0400, Brian Gerst wrote: > > The parameter area belongs to the callee, and it may *always* be modified. > > The parameters can not be modified if they are declared const though, > that's my point.
Yes they can.
extern void bar(int x, int y, int z); void foo(const int a, const int b, const int c) { bar(a+1, b+1, c+1); }
subl $12, %esp movl 20(%esp), %eax incl %eax movl %eax, 20(%esp) movl 16(%esp), %eax incl %eax incl 24(%esp) movl %eax, 16(%esp) addl $12, %esp jmp bar
(Not sure why gcc doesn't use incl on all three memories, nor should it allocate that stack frame...)
r~ - 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/
| |