linker segment requests in library code

cancel
Showing results for 
Search instead for 
Did you mean: 

linker segment requests in library code

506 Views
ahunsdon2
Contributor I

Hi Guys,

 

CodeWarrior for coldfire v7.1. linking a large (>4MB) project.

 

Project has a set oif libs including one that contains bitmaps and translateable strings. I want to place the strings in a separate part of the memory map so that they may be updated sepearate from the code.

 

In the resource file I have

#pragma    define_section    BCM_STRINGS ".bcm_strings"
/*---------------------------------------------------------------*/
ROMDATA PEGCHAR BCM_res_en_CurrentStr[] =
{   0x0043, 0x0075, 0x0072, 0x0072, 0x0065, 0x006e, 0x0074, 0x003a, 0};

 

and in the main project lcf file I have

   .= ALIGN(0x1000);
        *(.bcm_strings)    
   } > extflash

 

However it seems the section directives are being ignored. I have tried several different approaches and they all give the same result.

 

The only mechanism that seems to work is to put the resource file into the main build list rather than the library but this is not acceptable from a code management perspective.

 

Has anybody gotten this sort of memory mapping to work? am I missing something?

 

Any clues, pointers,etc etc gratefully received.

 

Thanks

 

Adrian

Labels (1)
0 Kudos
1 Reply

106 Views
CompilerGuru
NXP Employee
NXP Employee

The pragma define_section only defines the section, it does not actually cause that future objects get automatically added to the section. You have to qualify the objects (e.g. BCM_res_en_CurrentStr) with something like __declspec(BCM_STRINGS).

(unless this is there hidden behind some macro, in C you never know)

 

Daniel

0 Kudos