From 529f90444c8f76513f1c5d571e4bc2f2563029a6 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 12 Dec 2022 15:52:29 -0700 Subject: Fix the linker script to put the .got section in flash. The .got section contains global variables an offsets. Specifically it contains the linker script variables. The linker will automatically put this section .data, which is not what we want because those values will not be initialized. So we put the .got section in flash so the value is initialized. Without this, there is bizarre behavior on some compilers where linker variables will be undefined. --- linker/linker_script.ld | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linker/linker_script.ld b/linker/linker_script.ld index 8497768..d472646 100644 --- a/linker/linker_script.ld +++ b/linker/linker_script.ld @@ -15,6 +15,8 @@ SECTIONS *(.vectors); /* All .vector sections go here. */ VECTORS_END = .; + *(.got); /* Section to store the linker variables. */ + TEXT_START = .; *(.text); /* All .text sections go here. */ TEXT_END = .; -- cgit