show size of stack needed by functions

Anthony Foiani tkil@scrye.com
Thu Oct 14 05:33:00 GMT 2010


Apologies for continuing the somewhat off-topic thread...

Sebastian <sebastianspublicaddress@googlemail.com> writes:
> Static analysis which work on source code are not ideal, either. They
> don't know which functions will be inlined by the compiler.

I'm pretty sure that the Linux kernel developers have some scripts
that parse object files to determine deepest stack usage.  Here it is,
the "checkstack" target in the makefile:

checkstack:
        $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
        $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH)

The script itself can be viewed here:

   http://preview.tinyurl.com/3x7bgw4

HTH,
t.



More information about the Gcc mailing list