Prevent unbounded stack usage in libraries

From: Mark Wielaard <mjw at redhat dot com>

To: elfutils-devel at lists dot fedorahosted dot org

Date: Sat, 23 May 2015 23:10:13 +0200

Subject: Prevent unbounded stack usage in libraries

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