]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'feature/cxx_exceptions_emg_pool' into 'master'
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 23 Nov 2017 05:02:49 +0000 (13:02 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 23 Nov 2017 05:02:49 +0000 (13:02 +0800)
esp32: Adds C++ exceptions emergency pool size menuconfig option

See merge request !1561

1  2 
Kconfig

diff --cc Kconfig
index 416a9c2d3898163442aebd2d2097e64d0d1f4723,7e2596594b7a0112da9bc7eb3704efaacfa951bc..7cf6901029f8692eaced366b2cb07a994bfc4ab9
+++ b/Kconfig
@@@ -102,44 -102,17 +102,52 @@@ menuconfig CXX_EXCEPTION
         Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code which throws
         an exception will abort instead.
  
-        Enabling this option currently adds an additional 20KB of heap overhead, and 4KB of additional heap is allocated
-        the first time an exception is thrown in user code.
+        Enabling this option currently adds an additional ~500 bytes of heap overhead
+        when an exception is thrown in user code for the first time.
+ config CXX_EXCEPTIONS_EMG_POOL_SIZE
+     int "Emergency Pool Size"
+     default 0
+     depends on CXX_EXCEPTIONS
+     help
+        Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
+        memory for thrown exceptions when there is not enough memory on the heap.
  
 +choice STACK_CHECK_MODE
 +    prompt "Stack smashing protection mode"
 +    default STACK_CHECK_NONE
 +    help
 +        Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
 +        smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
 +        The guards are initialized when a function is entered and then checked when the function exits.
 +        If a guard check fails, program is halted. Protection has the following modes:
 +          - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with buffers larger than
 +            8 bytes are protected.
 +          - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes additional functions to be protected -- those that
 +            have local array definitions, or have references to local frame addresses.
 +          - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
 +
 +        Modes have the following impact on code performance and coverage:
 +          - performance: NORMAL > STRONG > OVERALL
 +          - coverage: NORMAL < STRONG < OVERALL
 +
 +
 +config STACK_CHECK_NONE
 +    bool "None"
 +config STACK_CHECK_NORM
 +    bool "Normal"
 +config STACK_CHECK_STRONG
 +    bool "Strong"
 +config STACK_CHECK_ALL
 +    bool "Overall"
 +endchoice
 +
 +config STACK_CHECK
 +    bool
 +    default !STACK_CHECK_NONE
 +    help
 +        Stack smashing protection.
 +
  endmenu # Compiler Options
  
  menu "Component config"