__check_stack and 'ip'

Nick Burrett nick at dsvr.net
Sun Dec 29 18:42:39 PST 2002


I'm concerned about the use of 'ip' within sys/_syslib.s::__check_stack.

AFAICT, the stack frame setup should not be strictly APCS compilant, 
since the __rt_stkovf_split_{small,big} functions aren't.

The problem I'm seeing is that __check_stack is corrupting 'ip' which 
GCC is using to pass a static chain reference for nested functions.  I 
could adjust GCC to pass the static chain in a different register, but 
I'm hoping not to, since it is easy to just fix __check_stack.

Fixing __check_stack is easy, but I'm wondering whether the 
SharedCLibrary guarantees that 'ip' is preserved during stack extension. 
  Does anybody know ?

Regards,

Nick.




More information about the gcc mailing list