This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Reducing the size of C++ executables - eliminating malloc
- From: Michael Eager <eager at eagercon dot com>
- To: GCC <gcc at gcc dot gnu dot org>, Newlib <newlib at sourceware dot org>
- Date: Sat, 11 Nov 2006 10:14:04 -0800
- Subject: Reducing the size of C++ executables - eliminating malloc
GCC 4.1.1 for PowerPC generates a 162K executable for a
minimal program "int main() { return 0; }". GCC 3.4.1
generated a 7.2K executable. Mark Mitchell mentioned the
same problem for ARM and proposed a patch to remove the
reference to malloc in atexit
(http://sourceware.org/ml/newlib/2006/msg00181.html).
There are references to malloc in eh_alloc.c and
unwind-dw2-fde.c. It looks like these are being
included even when there are no exception handlers.
Any suggestions on how to eliminate the references
to these routines?
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077