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), " |