This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Generating two identical target files except for linked location in Flash

Is there an easy way (i.e. not having to build twice using different configurations) to build the same set of code but located in different parts of memory?  Do I have to use different linker command files?  The only real difference between the two targets I want is the Section definition within the linker command file.  One points to region Flash A, the other to region Flash B.

Everything else identical, build flags, optimizations, etc., etc., etc.  Ultimately, I just want to invoke the build process once, and have two output files hex1.out and hex2.out that can be loaded in different parts of memory.

Thanks

  • Dan K87420 said:
    Is there an easy way (i.e. not having to build twice using different configurations) to build the same set of code but located in different parts of memory?

    No.

    Dan K87420 said:
    Do I have to use different linker command files?

    Yes.  Well, let me walk that back a bit.  You can have C preprocessor statements (like #ifdef SYMBOL_DEFINED_ON_CMD_LINE) in your linker command file.  And you could use that method to have one linker command file which automatically configures the SECTIONS directive based on a preprocessor symbol defined on the command line.  

    Thanks and regards,

    -George