AnsweredAssumed Answered

flash memory re-map using linker control (ld) file.

Question asked by Ming Jiang on Oct 2, 2014
Latest reply on Oct 6, 2014 by Jorge_Gonzalez

I would like to partition m_text (RX) section into two separate sections. One contains all ProcessorExpert generated code while the other one takes care of my application specific code. Within ld file, I divided m_text spaces into two sections: m_text2 and m_text. I attempted to specify a particular object generated by ProcessorExpert and place it under m_text2 while keeping the rest of code (.text) under m_text. The linker doesn't like it and generated an error.
The only usable method I have tried so far is using __attribute__((section(".xxxx"))) method, but it is impractical to manually place it before every functions generated by ProcessorExpert.


.generated_code :
          AD1.o (.text)
          . = ALIGN(4);
  } > m_text2 /* new section to include AD1.o generated by ProcessorExpert, that's the intention, NOT working */
  /* The program code and other data goes into INTERNAL_FLASH */
  .text :
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */

    KEEP (*(.init))
    KEEP (*(.fini))

    . = ALIGN(4);