Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

How to control linker from C code?

Anonymous
2011-11-14
2013-03-12

  • Anonymous
    2011-11-14

    Hi, I have a number of questions about how to interact with the linker from C code.  I'd like to be able to locate a particular function or data in a certain memory space.  Is there a way to define memory sections for the link other than the standard ones you have like (__code, __data, etc)?  I have a certain portion of my memory that is non-volatile and would like to be able to use it appropriately. 
    Also, I've seen other compilers (IAR) use a __no_init keyword that somehow tells the c runtime startup code not to touch that memory space.
    I guess one answer to my question might be to use the __at keyword but I guess I'd like to not specify the exact address but just the section.

    Thanks,

    Chris