This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: show size of stack needed by functions
- From: Anthony Foiani <tkil at scrye dot com>
- To: sebastianspublicaddress at googlemail dot com
- Cc: Ian Lance Taylor <iant at google dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 13 Oct 2010 23:33:49 -0600
- Subject: Re: show size of stack needed by functions
- References: <1287000338.3466.9.camel@svetz> <mcrd3rdrgsm.fsf@google.com> <1287006198.3466.34.camel@svetz>
- Reply-to: Anthony Foiani <tkil at scrye dot com>
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.