rust-embedded/cortex-m

Why assert _stext is within FLASH?

meowcakes opened this issue · 2 comments

In link.x.in there is an ASSERT to prevent _stext being outside of flash. This prevents e.g. running the code from RAM after loading .text into RAM inside a pre_init with .text configured like

.text :
  {
      ...
  } > RAM AT > FLASH

ASSERT(_stext >= ORIGIN(FLASH) && _stext < ORIGIN(FLASH) + LENGTH(FLASH), "

To configure such a .text, wouldn't you need a custom linker script anyway, at which point you can just not include that assert?