This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Quick access to stack bounds
On 12/08/2009 04:56 PM, Ulrich Drepper wrote:
This is needed for other reasons as well. Only problem is that as long
as there still is a PROT_GROWS{UP,DOWN} implementation in the kernel the
answer is not definitive.
The PROT_GROWS_DOWN implementation extends the vma? I had thought the
reserved address space was fixed and the flag was merely a hint for how
to allocate pages within that vma. That does add a wrinkle...
Redefined to be the top of the stack + SPLIT_STACK_AVAILABLE.
Why the addend?
The split stack feature needs this for efficiency. The function
prologue emitted (for small frame sizes) looks like
cmp %fs:ofs, %rsp
jb .Lcall_morestack
The alternative is
lea -SPLIT_STACK_AVAILABLE(%rsp), %r10
cmp %fs:ofs, %r10
jb .Lcall_morestack
I'd like to support the more efficient form, but it's true that it
wouldn't be the end of the world to always use the lea form that's
already used for large frame sizes.
The problem is that in theory this information can be used now. It would
of course be much better to use what is available.
It can? Where is this stored?
r~