Prevent unbounded stack usage in libraries

Mark Wielaard mjw at redhat.com
Sat May 23 21:10:13 UTC 2015


Hi,

The following patches makes sure we can use gcc -Wstack-usage
to check there is no unbounded stack usage. This is mostly done by
changing unbounded alloca or dynamic stack arrays into a fixed bounded
stack array or just calling malloc and free directly.

The last patch adds -Wstack-usage to eu.am enabled by default.
All the library code now compiles without stack-usage warnings.
Most of the src tools files don't yet. Exceptions have been added
to src/Makefile.am. I hope to eventually be able to build everything
with bounded stack usage that the compiler can check.

Cheers,

Mark


More information about the elfutils-devel mailing list