Bss data in S19 records

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

Bss data in S19 records

2,306 Views
Southernboy
Contributor I
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;
}
Labels (1)
0 Kudos
Reply
1 Reply

842 Views
CrasyCat
Specialist III
Hello
 
According to the ColdFire_Build_Tools_Reference.pdf, this is exactly the purpose of the command ZERO_FILL_UNINITIALIZED.
 
Extract from manual:
"Forces the linker to put zeroed data into the binary file for uninitialized variables."
 
So if the zeroed data are put into the binary file they also appear in the S19 file.
The S19 file is just an ASCII text representation of the binary image.
 
If you so not want to see content of bss in the s19 file, remove the command ZERO_FILL_UNINITIALIZED from the linker command file.
 
CrasyCat
0 Kudos
Reply