Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22295

Excluding .text & .text* of a particular file from a pre-complied library in GCC linker script

$
0
0

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


Viewing all articles
Browse latest Browse all 22295

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>