Skip to content

Commit abd24ae

Browse files
AlessandroAmeriac
authored andcommitted
K64F: Explicitly set the start of .text
If you don't specify the start address of a section explicitly, that section can end up at different addresses depending on its alignment. If the alignment of a section is not explicitly set, it inherits it from the element with the highest alignment inside that section. Since the uVisor code is in the .text section, and it *must* end up at a known location, we set the start address of .text to 0x410, which is the value that the uVisor binary expects.
1 parent 23eadc7 commit abd24ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hal/targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ SECTIONS
9090
} > m_flash_config
9191

9292
/* The program code and other data goes into internal flash */
93-
.text :
93+
/* Note: The uVisor expects this section at a fixed location, as specified by
94+
* the porting process configuration parameter: FLASH_OFFSET. */
95+
__UVISOR_TEXT_OFFSET = 0x410;
96+
__UVISOR_TEXT_START = ORIGIN(m_interrupts) + __UVISOR_TEXT_OFFSET;
97+
.text __UVISOR_TEXT_START :
9498
{
9599
/* uVisor code and data */
96100
. = ALIGN(4);

0 commit comments

Comments
 (0)