-fstack-check on MIPS

Pan ruochen panruochen@gmail.com
Thu Jul 2 02:47:00 GMT 2009


Hi All,
I compile with -fstack-check and check the disassembly file.
gcc generates a `sw zero,-4392(sp)' instruction before every function call.
I think -4392(sp) is used as a guard to check if the stack has been overflow
during the function is executed. What I does not understand is there is not
a call to ___chkstk on return of the function call. If I miss the chance to
check the guard word, when the stack check action should be executed? And how
the check action is invoked?

BTW, I wonder how gcc decides the offset is -4392? Can I change the value by
some option?

-------------
Best Regards,
PRC
Jul 2, 2008



More information about the Gcc-help mailing list