From 51d493fb5af8ce901d52181a1bb78e6516f0c7fd Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sun, 1 Feb 2026 15:09:27 +0100 Subject: [PATCH] fixes linker script to place .data with offset if ram is at address 0 --- src/sections.ld | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sections.ld b/src/sections.ld index c731c49..67cf800 100644 --- a/src/sections.ld +++ b/src/sections.ld @@ -11,7 +11,8 @@ SECTIONS { __stack_size = DEFINED(__stack_size) ? __stack_size : 2K; __stack_segment_size = DEFINED(__stack_segment_size) ? __stack_segment_size : __stack_size; - + __data_vma_base = ORIGIN(LOCATION_DATA) + ((ORIGIN(LOCATION_DATA) == 0) ? 0x10 : 0); + /* Code/Const in LOCATION_TEXT */ . = ORIGIN(LOCATION_TEXT); .text : ALIGN(4) @@ -48,7 +49,7 @@ SECTIONS } > LOCATION_TEXT :text /* .data in LOCATION_DATA, Load-Image in LOCATION_TEXT, PHDR is data */ - .data : ALIGN(4) + .data __data_vma_base : ALIGN(4) { __data_start = .; *(.data .data.*)