Neil Martin

Bss data in S19 records

Discussion created by Neil Martin on Feb 12, 2008
Latest reply on Feb 13, 2008 by CrasyCat
Hi,  I hope someone can help me with this one. I'm sure someone must have posted this one before, but I cannot find a similar post so here goes. Whatever I do to the linked file, the S19 file always includes the BSS uninitialised data. This is starting to create a problem for me, since I am using a large amount of data and the Flash is filled with either rubbish data, or with zeros if I use ZERO_FILL_UNINITIALIZED.
This is the LCF I am using: If anyone has any suggestions please could you help. I am using Codewarrior 6.3 for coldfire.
 
Thanks in advance
 
Neil
 
# Sample Linker Command File for CodeWarrior for ColdFire
MEMORY
{
 sram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x01000000
 user (RWX) : ORIGIN = 0x20000400, LENGTH = 0x01000000
 ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x40000000
 flash (RWX) : ORIGIN = 0x00000000, LENGTH = 0x00200000
}
ZERO_FILL_UNINITIALIZED
SECTIONS
{
 .ipsbar  : {} > ipsbar
 .sram  : {} > sram
 
 .vectors :
 {
  vectors.s (.text)
  . = ALIGN (0x10);
 } > flash
 .text :
 {
  . = ALIGN (0x10);
  *(.text)
  . = ALIGN (0x10);
  *(.rodata)
  . = ALIGN (0x10);  
  ___DATA_ROM = .;
 } >> flash
 .data : AT(___DATA_ROM)
 { 
  ___DATA_RAM = .;
  __START_DATA = .;
  *(.data)
  __END_DATA = .;
  . = ALIGN (0x10);
  __START_SDATA = .;
  *(.sdata)
  __END_SDATA = .;
  __SDA_BASE = .;
  . = ALIGN (0x10);  
 } > user
 
 .bss :
 {
  . = ALIGN (0x10);
  __START_SBSS = .;
  *(.sbss)
  *(SCOMMON)
  __END_SBSS = .;
  
  . = ALIGN (0x10);
  __START_BSS = .;
  *(.bss)
  *(COMMON)
  __END_BSS = .;
  . = ALIGN (0x10);  
 } >> user
 _romp_at = ___DATA_ROM + SIZEOF(.data);
 .romp : AT(_romp_at)
 {
  __S_romp = _romp_at;
  WRITEW(___DATA_ROM);
  WRITEW(ADDR(.data));
  WRITEW(SIZEOF(.data));
  WRITEW(0);
  WRITEW(0);
  WRITEW(0);
 }
 
 ___IPSBAR  = ADDR(.ipsbar);
 ___SRAM   = ADDR(.sram);
 ___SRAM_SIZE = 0x00010000;
    ___VECTOR_START = ADDR(.vectors); 
 ___SP_INIT  = ___SRAM + ___SRAM_SIZE; 
 __SP_INIT  = ___SP_INIT;
}

Outcomes