Re:Practical Guide to Bare Metal C++
by WalterBright on Thursday July 21, 2016 @03:48PM
(#12139521)
The exception handling code in the GCC library is a lot more than 600 bytes. But if you were linking with the shared library, it won't be reflected in the size of the executable. Linking with the static library may show a quite different story.
[ Parent
| on HN ]
Re:Practical Guide to Bare Metal C++
by mattkrause on Thursday July 21, 2016 @04:01PM
(#12139610)
Even when linked statically, my "Hello World" program is only 10,332 bytes larger than something which prints "Hello World" and then throws an integer.
Building the no exceptions version with -fno-exceptions doesn't change the size of the exception-free version either.
(g++ 4.8.5 with -Os)
Re:Practical Guide to Bare Metal C++
by WalterBright on Thursday July 21, 2016 @04:16PM
(#12139713)
All functions get compiled with exception handling unwind data, so you're going to get that pulled in whether the executable throws or not.
In order to not get that, you'll likely have to rebuild the entire runtime library with EH turned off.