Prevent unbounded stack usage in libraries

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


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 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/ I hope to eventually be able to build everything
with bounded stack usage that the compiler can check.



More information about the elfutils-devel mailing list