Joe Haas

Assigning global variable locations in linker

Discussion created by Joe Haas on Apr 20, 2006
Latest reply on Apr 24, 2006 by CrasyCat
I am using CW fo CF v6.x.
 
Is there any way to use the linker to assign global variable locations in memory?  "OBJECT" doesn't seem to work and the only other way I have been able to control the location of global variables is to declare them in reverse order from how I wish for them to be assigned and then force the declaration file to be the first in line in the .bss segment (main.c below):
 
 .uninitialized_data :
 {
  __START_SBSS = .;
  *(.sbss)
  . = ALIGN(0x8);
  *(SCOMMON)
  __END_SBSS = .;
  __START_BSS = .;
  main.c(.bss)
  *(.bss)
  . = ALIGN(0x8);
  *(COMMON)
  __END_BSS = .; 
  . = ALIGN(0x8);
 } > DATA

 
Also, I have the "targeting for Coldfire" manual which discusses the linker.  Is this the most comprehensive linker guide that exists or is there a document that covers the linker more in depth?  For example, what does .bss and .sbss stand for?
 
Thanks,
 
Joe
 

Outcomes