Topic : Use preprocessor directives in the linker file?

Forum : ARM

Original Post
Post Information Post
April 9, 2009 - 11:09am
Guest

Hello

I would like to be able to select the memory region where my program ends up.

In my *.ld file i would like to do this:

#if USE_UPPER_REGION
FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 32K
#else
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 32K
#endif

Is it possible?

Replies
Post Information Post
+1
0
-1
April 9, 2009 - 11:12am
Raisonance Support Team

Hi,

I'm afraid this is not possible: the preprocessing is done before compiling, while the linker script is used during the link, which is after compiling.
If there is another syntax for doing that, I don't know it.
Please refer to the LD documentation for more information, or maybe ask on the GCC forums.

Best Regards,

Vincent