aboutsummaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorIan McIntyre <me@mciantyre.dev>2025-03-12 21:50:39 -0400
committerIan McIntyre <me@mciantyre.dev>2025-03-13 20:14:25 -0400
commit4ecbed698241e637a13048a199d29c142445c360 (patch)
tree5bafdd61d301a8222f00b37a9ffa00f9bff76c6a /src/host
parent49385f56eab2dcdbe89cd156ba4e8be95b14e99e (diff)
Place .xip sections into flash
We added the `.xip` section to ensure that the reset handler and pre-init functions would be placed in flash. This commit lets users place other content into that section. `.xip` is intended for instructions. The runtime builder will place these instructions into the same load region as `.text`. However, there's no pre-`main` relocation. Aligning the `.xip` and the `.text` section produces more predictable behavior between GNU's ld and LLVM's lld.
Diffstat (limited to 'src/host')
-rw-r--r--src/host/imxrt-link.x5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/host/imxrt-link.x b/src/host/imxrt-link.x
index a389325..dfe7355 100644
--- a/src/host/imxrt-link.x
+++ b/src/host/imxrt-link.x
@@ -70,14 +70,15 @@ SECTIONS
__sivector_table = LOADADDR(.vector_table);
/* This section guarantees VMA = LMA to allow the execute-in-place entry point to be inside the image. */
- .xip :
+ .xip : ALIGN(4)
{
/* Included here if not otherwise included in the boot header. */
*(.Reset);
*(.__pre_init);
+ *(.xip .xip.*);
} > REGION_LOAD_TEXT
- .text :
+ .text : ALIGN(4)
{
FILL(0xff);
__stext = .;