diff options
Diffstat (limited to 'src/host/imxrt-link.x')
| -rw-r--r-- | src/host/imxrt-link.x | 72 |
1 files changed, 43 insertions, 29 deletions
diff --git a/src/host/imxrt-link.x b/src/host/imxrt-link.x index f07601b..c04e3d4 100644 --- a/src/host/imxrt-link.x +++ b/src/host/imxrt-link.x @@ -54,6 +54,7 @@ SECTIONS .vector_table : ALIGN(1024) { FILL(0xff); + . = ALIGN(8); __vector_table = .; __svector_table = .; @@ -70,12 +71,14 @@ SECTIONS /* Device specific interrupts */ KEEP(*(.vector_table.interrupts)); /* this is the `__INTERRUPTS` symbol */ + + . = ALIGN(8); __evector_table = .; } > REGION_VTABLE AT> REGION_LOAD_VTABLE __sivector_table = LOADADDR(.vector_table); /* This section guarantees VMA = LMA to allow the execute-in-place entry point to be inside the image. */ - .xip : ALIGN(4) + .xip : ALIGN(8) { /* Included here if not otherwise included in the boot header. */ *(.Reset); @@ -83,7 +86,7 @@ SECTIONS *(.xip .xip.*); } > REGION_LOAD_TEXT - .text : ALIGN(4) + .text : ALIGN(8) { FILL(0xff); __stext = .; @@ -92,60 +95,56 @@ SECTIONS so must be placed close to it. */ *(.HardFaultTrampoline); *(.HardFault.*); - . = ALIGN(4); /* Pad .text to the alignment to workaround overlapping load section bug in old lld */ + . = ALIGN(8); __etext = .; } > REGION_TEXT AT> REGION_LOAD_TEXT __sitext = LOADADDR(.text); - .rodata : ALIGN(4) + .rodata : ALIGN(8) { FILL(0xff); - . = ALIGN(4); + . = ALIGN(8); __srodata = .; *(.rodata .rodata.*); - - /* 4-byte align the end (VMA) of this section. - This is required by LLD to ensure the LMA of the following .data - section will have the correct alignment. */ - . = ALIGN(4); + . = ALIGN(8); __erodata = .; } > REGION_RODATA AT> REGION_LOAD_RODATA __sirodata = LOADADDR(.rodata); - .data : ALIGN(4) + .data : ALIGN(8) { FILL(0xff); - . = ALIGN(4); + . = ALIGN(8); __sdata = .; *(.data .data.*); - . = ALIGN(4); /* 4-byte align the end (VMA) of this section */ + . = ALIGN(8); __edata = .; } > REGION_DATA AT> REGION_LOAD_DATA __sidata = LOADADDR(.data); - .bss (NOLOAD) : ALIGN(4) + .bss (NOLOAD) : ALIGN(8) { - . = ALIGN(4); + . = ALIGN(8); __sbss = .; *(.bss .bss.*); *(COMMON); /* Uninitialized C statics */ - . = ALIGN(4); /* 4-byte align the end (VMA) of this section */ + . = ALIGN(8); __ebss = .; } > REGION_BSS - .uninit (NOLOAD) : ALIGN(4) + .uninit (NOLOAD) : ALIGN(8) { - . = ALIGN(4); + . = ALIGN(8); __suninit = .; *(.uninit .uninit.*); - . = ALIGN(4); + . = ALIGN(8); __euninit = .; } > REGION_UNINIT - .heap (NOLOAD) : ALIGN(4) + .heap (NOLOAD) : ALIGN(8) { __sheap = .; - . += ALIGN(__heap_size, 4); + . += ALIGN(__heap_size, 8); __eheap = .; } > REGION_HEAP @@ -171,17 +170,32 @@ SECTIONS ASSERT(__sstack % 8 == 0 && __estack % 8 == 0, " BUG(imxrt-rt): .stack is not 8-byte aligned"); -ASSERT(__sdata % 4 == 0 && __edata % 4 == 0, " -BUG(imxrt-rt): .data is not 4-byte aligned"); +ASSERT(__stext % 8 == 0 && __etext % 8 == 0, " +BUG(imxrt-rt): .text is not 8-byte aligned"); + +ASSERT(__sitext % 8 == 0, " +BUG(imxrt-rt): the LMA of .text is not 8-byte aligned"); + +ASSERT(__srodata % 8 == 0 && __erodata % 8 == 0, " +BUG(imxrt-rt): .rodata is not 8-byte aligned"); + +ASSERT(__sirodata % 8 == 0, " +BUG(imxrt-rt): the LMA of .rodata is not 8-byte aligned"); + +ASSERT(__sdata % 8 == 0 && __edata % 8 == 0, " +BUG(imxrt-rt): .data is not 8-byte aligned"); + +ASSERT(__sidata % 8 == 0, " +BUG(imxrt-rt): the LMA of .data is not 8-byte aligned"); -ASSERT(__sidata % 4 == 0, " -BUG(imxrt-rt): the LMA of .data is not 4-byte aligned"); +ASSERT(__sbss % 8 == 0 && __ebss % 8 == 0, " +BUG(imxrt-rt): .bss is not 8-byte aligned"); -ASSERT(__sbss % 4 == 0 && __ebss % 4 == 0, " -BUG(imxrt-rt): .bss is not 4-byte aligned"); +ASSERT(__suninit % 8 == 0 && __euninit % 8 == 0, " +BUG(imxrt-rt): .uninit is not 8-byte aligned"); -ASSERT(__sheap % 4 == 0, " -BUG(imxrt-rt): start of .heap is not 4-byte aligned"); +ASSERT(__sheap % 8 == 0 && __eheap % 8 == 0, " +BUG(imxrt-rt): .heap is not 8-byte aligned"); /* # Position checks */ |
