emergency_buffer in libstdc++ 4.9.2-5

Asked by mr.lahorde

Hello,

Today I've upgraded arm-none-eabi-gcc from 4.9.2-4 => 4.9.2-5
Building image with this version is not possible anymore. Indeed in my binary emergency_buffer symbol of 0x800 is present => heap overflows stack.
I've compiled with no-exceptions flag because I do not want to use c++ exceptions.
As in this post, https://gcc.gnu.org/ml/gcc-help/2009-06/msg00329.html would be to compile libstdc++ with given options.
But my question is why by default libstdc++ compiled with emergency_buffer? Why such a buffer size on an embedded system?

Here are compilation options :
arm-none-eabi-g++ -mcpu=cortex-m0 -mthumb -O0 -ffunction-sections -fdata-sections -Wall -g -std=c++11 -fno-exceptions -fno-rtti

Regards

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
mr.lahorde
Solved:
Last query:
Last reply:
Revision history for this message
Joey Ye (jinyun-ye) said :
#1

Data structure for exception is still needed by libraries. If you could try to use -fno-exceptions to build libstdc++ library it may work. Also if you are using the standard build script of this toolchain, lib is already built with -fno-exceptions --specs=nano.specs is specified in linker commands line.

Thanks,
Joey

Revision history for this message
mr.lahorde (mr-lahorde) said :
#2

Thanks Joey for your reply,

I get libstdc++ from my distro. I do not know why standard build script has not been used. Fortunately, I can use nano for my project. It saved me lot of RAM, I did not took care of impure_data before, it occupied lot of RAM

Without nano :
 .data.impure_data
                0x0000000020002148 0x428

With nano :
 .data.impure_data
                0x0000000020002148 0x60

Thanks for your support.