From 4ecbed698241e637a13048a199d29c142445c360 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Wed, 12 Mar 2025 21:50:39 -0400 Subject: 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. --- src/host/imxrt-link.x | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/host/imxrt-link.x') 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 = .; -- cgit v1.2.3