summaryrefslogtreecommitdiff
path: root/core/cortex-m/ec.lds.S
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m/ec.lds.S')
-rw-r--r--core/cortex-m/ec.lds.S16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 24f3030354..6beb007dba 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -225,11 +225,6 @@ SECTIONS
#endif
__ro_end = . ;
- __deferred_funcs_count =
- (__deferred_funcs_end - __deferred_funcs) / 4;
- ASSERT(__deferred_funcs_count <= DEFERRABLE_MAX_COUNT,
- "Increase DEFERRABLE_MAX_COUNT")
-
.bss : {
/*
* Align to 512 bytes. This is convenient when some memory block
@@ -244,6 +239,17 @@ SECTIONS
*(.bss.system_stack)
/* Rest of .bss takes care of its own alignment */
*(.bss)
+
+ /*
+ * Reserve space for deferred function firing times. Each time is a
+ * uint64_t, each func is a 32-bit pointer, thus the scaling factor of
+ * two. The 8 byte alignment of uint64_t is required by the ARM ABI.
+ */
+ . = ALIGN(8);
+ __deferred_until = .;
+ . += (__deferred_funcs_end - __deferred_funcs) * (8 / 4);
+ __deferred_until_end = .;
+
#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
. = ALIGN(4);
__bss_end = .;