Skip to content

Commit 9e9b799

Browse files
karlpBOJIT
authored andcommitted
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 <karlp@tweak.net.au>
1 parent 0fbc8bf commit 9e9b799

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

ld/linker.ld.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ SECTIONS
127127
.data : {
128128
_data = .;
129129
*(.data*) /* Read-write initialized data */
130+
*(.ramtext*) /* "text" functions to run in ram */
130131
. = ALIGN(4);
131132
_edata = .;
132133
} >ram AT >rom

lib/cortex-m-generic.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ SECTIONS
9898
.data : {
9999
_data = .;
100100
*(.data*) /* Read-write initialized data */
101+
*(.ramtext*) /* "text" functions to run in ram */
101102
. = ALIGN(4);
102103
_edata = .;
103104
} >ram AT >rom

0 commit comments

Comments
 (0)