Conditional statement in linker file for s32k144

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Conditional statement in linker file for s32k144

Jump to solution
1,140 Views
stark21
Contributor II

Hello team,

How to add conditional statement in linker file for s32k144
Following is my memory sections

MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00002000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00002400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00002410, LENGTH = 0x0007FBF0

/* SRAM_L */
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000

/* SRAM_U */
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00007000
}
so here i wanted to add conditional statement in memory section part, so that we i compile for APP1 it should compile with above memory section and if i want to compile for APP2 it should compile with below memory section

MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00008000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00008400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00009410, LENGTH = 0x0007FBF0

/* SRAM_L */
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000

/* SRAM_U */
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00007000
}
Please guide us on same.

Tags (3)
0 Kudos
Reply
1 Solution
1,131 Views
danielmartynek
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
1 Reply
1,132 Views
danielmartynek
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2062826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EConditional%20statement%20in%20linker%20file%20for%20s32k144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2062826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20team%2C%3C%2FP%3E%3CP%3EHow%20to%20add%20conditional%20statement%20in%20linker%20file%20for%20s32k144%3CBR%20%2F%3EFollowing%20is%20my%20memory%20sections%3C%2FP%3E%3CP%3EMEMORY%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%2F*%20Flash%20*%2F%3CBR%20%2F%3Em_interrupts%20(RX)%20%3A%20ORIGIN%20%3D%200x00002000%2C%20LENGTH%20%3D%200x00000400%3CBR%20%2F%3Em_flash_config%20(RX)%20%3A%20ORIGIN%20%3D%200x00002400%2C%20LENGTH%20%3D%200x00000010%3CBR%20%2F%3Em_text%20(RX)%20%3A%20ORIGIN%20%3D%200x00002410%2C%20LENGTH%20%3D%200x0007FBF0%3C%2FP%3E%3CP%3E%2F*%20SRAM_L%20*%2F%3CBR%20%2F%3Em_data%20(RW)%20%3A%20ORIGIN%20%3D%200x1FFF8000%2C%20LENGTH%20%3D%200x00008000%3C%2FP%3E%3CP%3E%2F*%20SRAM_U%20*%2F%3CBR%20%2F%3Em_data_2%20(RW)%20%3A%20ORIGIN%20%3D%200x20000000%2C%20LENGTH%20%3D%200x00007000%3CBR%20%2F%3E%7D%3CBR%20%2F%3Eso%20here%20i%20wanted%20to%20add%20conditional%20statement%20in%20memory%20section%20part%2C%20so%20that%20we%20i%20compile%20for%20APP1%20it%20should%20compile%20with%20above%20memory%20section%20and%20if%20i%20want%20to%20compile%20for%20APP2%20it%20should%20compile%20with%20below%20memory%20section%3C%2FP%3E%3CP%3EMEMORY%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%2F*%20Flash%20*%2F%3CBR%20%2F%3Em_interrupts%20(RX)%20%3A%20ORIGIN%20%3D%200x00008000%2C%20LENGTH%20%3D%200x00000400%3CBR%20%2F%3Em_flash_config%20(RX)%20%3A%20ORIGIN%20%3D%200x00008400%2C%20LENGTH%20%3D%200x00000010%3CBR%20%2F%3Em_text%20(RX)%20%3A%20ORIGIN%20%3D%200x00009410%2C%20LENGTH%20%3D%200x0007FBF0%3C%2FP%3E%3CP%3E%2F*%20SRAM_L%20*%2F%3CBR%20%2F%3Em_data%20(RW)%20%3A%20ORIGIN%20%3D%200x1FFF8000%2C%20LENGTH%20%3D%200x00008000%3C%2FP%3E%3CP%3E%2F*%20SRAM_U%20*%2F%3CBR%20%2F%3Em_data_2%20(RW)%20%3A%20ORIGIN%20%3D%200x20000000%2C%20LENGTH%20%3D%200x00007000%3CBR%20%2F%3E%7D%3CBR%20%2F%3EPlease%20guide%20us%20on%20same.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2062931%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Conditional%20statement%20in%20linker%20file%20for%20s32k144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2062931%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242872%22%20target%3D%22_blank%22%3E%40stark21%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EIt%20was%20discussed%20here%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F35796465%2Fconditional-statements-for-linker-command-language-ld%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F35796465%2Fconditional-statements-for-linker-command-language-ld%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E