I am building a application for cortex-m4 MCU, and this MCU has XIP internal flash feature (executable in place). And in my application I have to read and write some configuration in the same internal flash where its executing the code. And it's only possible if the read/write functions along with flash driver code should be executed from RAM instead of XIP flash.
For example, in my application there is a file name fastexec.c and it's object file after compile is fastexec.o. To exclude whole file(fastexec.o) from flash storage section and mapped to RAM. I use below syntax and that work
.text :{ *(EXCLUDE_FILE(*/fastexec.o) .text) *(EXCLUDE_FILE(*/fastexec.o) .text*)......}.data :{.... *(.ramfunc*)*/fastexec.o(.text text* .rodata .rodata*)....}}
Now I am facing problem, when fastexec.c file is compile as a library with some other files and then while linking I would like to exclude the object code from this file of the generated library and map to RAM. If i use the same above syntax then in generated map file, it doesn't has .text .text* from fastexec.o to (.ramfunc*).
I am not sure if that syntax will work, appreciate any guidance to fix this issue
Thanks