user2477075
user2477075

Reputation: 21

Can we place code in memory section other than .text section?

I am working on a DSC by Texas Instrument in C language. I want to know whether i can place my code in predefined memory section other than .text section? if yes then how??

Upvotes: 1

Views: 190

Answers (2)

Clifford
Clifford

Reputation: 93556

In most cases yes, but the capability and the method will be linker and/or compiler specific. Check the documentation for your particular tool-chain. It may may be by compiler directive, or by explicit allocation in the linker script.

Upvotes: 1

dbrank0
dbrank0

Reputation: 9476

In gcc you can select section function is placed into using section function attribute. Use is explained here: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html.

Together with linker script that places this section(s) at some appropriate region of memory, this works on "generic system".

Upvotes: 0

Related Questions