@@ -927,7 +927,6 @@ __asm(".global __use_no_semihosting\n\t");
927927// Through weak-reference, we can check if ARM_LIB_HEAP is defined at run-time.
928928// If ARM_LIB_HEAP is defined, we can fix heap allocation.
929929extern MBED_WEAK uint32_t Image$$ARM_LIB_HEAP$$ZI$$Base[];
930- extern MBED_WEAK uint32_t Image$$ARM_LIB_HEAP$$ZI$$Length[];
931930extern MBED_WEAK uint32_t Image$$ARM_LIB_HEAP$$ZI$$Limit[];
932931
933932// Heap here is considered starting after ZI ends to Stack start
@@ -942,7 +941,7 @@ extern "C" MBED_WEAK __value_in_regs struct __initial_stackheap _mbed_user_setup
942941 struct __initial_stackheap r;
943942
944943 // Fix heap if ARM_LIB_HEAP is defined
945- if (Image$$ARM_LIB_HEAP$$ZI$$Length ) {
944+ if (Image$$ARM_LIB_HEAP$$ZI$$Base != Image$$ARM_LIB_HEAP$$ZI$$Limit ) {
946945 heap_base = (uint32_t ) Image$$ARM_LIB_HEAP$$ZI$$Base;
947946 heap_limit = (uint32_t ) Image$$ARM_LIB_HEAP$$ZI$$Limit;
948947 }
@@ -965,7 +964,7 @@ extern "C" __value_in_regs struct __argc_argv $Sub$$__rt_lib_init(unsigned heapb
965964 uint32_t heap_limit = (uint32_t )Image$$ARM_LIB_STACK$$ZI$$Base;
966965
967966 // Fix heap if ARM_LIB_HEAP is defined
968- if (Image$$ARM_LIB_HEAP$$ZI$$Length ) {
967+ if (Image$$ARM_LIB_HEAP$$ZI$$Base != Image$$ARM_LIB_HEAP$$ZI$$Limit ) {
969968 heap_base = (uint32_t ) Image$$ARM_LIB_HEAP$$ZI$$Base;
970969 heap_limit = (uint32_t ) Image$$ARM_LIB_HEAP$$ZI$$Limit;
971970 }
0 commit comments