From b88196f8074751cbcef3e3cf7e272bd518aab475 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Fri, 16 Oct 2020 12:08:14 +0000 Subject: [PATCH] ld: support ".ramtext" section hook to place functions in ram We already had the hooks for ccmram and ram1 and ram2 and ram3 and xsram for "other" ram sections, but there was no method, out of the box, for placing a function in "normal" ram. The "easy" method of labelling a function as ".data.someramfunc" causes warnings because code isn't meant to have a name like ".data*" so we must explicitly add a new code section. Signed-off-by: Karl Palsson --- ld/linker.ld.S | 1 + lib/cortex-m-generic.ld | 1 + 2 files changed, 2 insertions(+) diff --git a/ld/linker.ld.S b/ld/linker.ld.S index 84c1cd18..20aaf024 100644 --- a/ld/linker.ld.S +++ b/ld/linker.ld.S @@ -127,6 +127,7 @@ SECTIONS .data : { _data = .; *(.data*) /* Read-write initialized data */ + *(.ramtext*) /* "text" functions to run in ram */ . = ALIGN(4); _edata = .; } >ram AT >rom diff --git a/lib/cortex-m-generic.ld b/lib/cortex-m-generic.ld index 8b995d35..f7b1da01 100644 --- a/lib/cortex-m-generic.ld +++ b/lib/cortex-m-generic.ld @@ -98,6 +98,7 @@ SECTIONS .data : { _data = .; *(.data*) /* Read-write initialized data */ + *(.ramtext*) /* "text" functions to run in ram */ . = ALIGN(4); _edata = .; } >ram AT >rom