[coldfire-gnu-discuss] GNU link error with code sourcery

vika vika vika238 at yahoo.com
Tue Jan 23 22:14:12 UTC 2007


Hi All
  I could compile and link my source code with codesourcery GNU but now I am facing problem with C++ constructor. my program crash at c++ constructor. I am giving my linker file. C program works fine. 
  I am linking my code as follows 
  CF2_CC :=m68k-elf-gcc -fno-builtin -mcpu=5275 -mdiv -gstabs 
  CF2_CCP :=m68k-elf-g++ -fno-builtin -mcpu=5275 -mdiv -gstabs 
   
  //c++ code 
  $(OBJS_CC): %.o: ./xyz/xyx/%.cpp
  $(CF2_CCP) -c  -Wa,-adhls=$*.ls -o $@ $< 
   
  //similarly c code 
   
   
  //linking all with g++
   
  gnutest.obj: $(C_CPP_OBJ) linkfile.ld 
  $(CF2_CCP) $(LDFLAGS) -Tlinkfile.ld -lgcc -nostartfiles -o $@ $(C_CPP_OBJ) 
   
   
  My linker file 
   
  MEMORY 
  {
  sdram (RWX) : ORIGIN = 0x00000000, LENGTH = 0x01000000
  vector_ram (RWX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
  user (RWX) : ORIGIN = 0x00020000, LENGTH = 0x00FE0000
  sram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00010000
  ext_sram (RWX) : ORIGIN = 0x30000000, LENGTH = 0x00080000
  ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x40000000
  ext_flash (RWX) : ORIGIN = 0xFFE00000, LENGTH = 0x00200000
  }
  SECTIONS 
  {
  .sdram : {} > sdram
  .vector_ram : {} > vector_ram
  .ipsbar : {} > ipsbar
  .sram : {} > sram
  .ext_sram : {} > ext_sram
  .ext_flash : {} > ext_flash
  
  .vectors :
  {
  vectors.o (.text)
  } > user
  .text :
  {
  . = ALIGN (0x10);
  *(.text)
  . = ALIGN(0x10);
  __CTOR_LIST__ = .;
  ___CTOR_LIST__ = .;
  LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
  *(.ctors)
  LONG(0)
  __CTOR_END__ = .;
  __DTOR_LIST__ = .;
  ___DTOR_LIST__ = .;
  LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
  *(.dtors)
  LONG(0)
  __DTOR_END__ = .;
  . = ALIGN (0x10);
  *(.rodata)
  } > user
  .data :
  { 
  __DATA_ROM = .;
  __DATA_RAM = .;
  . = ALIGN (0x10);
  *(.data)
  . = ALIGN (0x10);
  *(.sdata)
  __DATA_END = .;
  } > user
  
  .bss :
  {
  . = ALIGN (0x10);
  __BSS_START = .;
  *(.sbss)
  *(SCOMMON)
  *(.bss)
  *(COMMON)
  __BSS_END = .;
  } > user
  
  .custom :
  {
  . = ALIGN (0x10);
  __HEAP_START = .;
  . = . + 0x30000;
  __HEAP_END = .;
  __SP_END = .;
  . = . + 0x30000;
  __SP_INIT = .;
  } > user
  
  __IPSBAR = ADDR(.ipsbar);
  __VECTOR_RAM = ADDR(.vector_ram);
  __SDRAM = ADDR(.sdram);
  __SDRAM_SIZE = 0x01000000;
  __SRAM = ADDR(.sram);
  __SRAM_SIZE = 0x00010000;
  __EXT_SRAM = ADDR(.ext_sram);
  __EXT_SRAM_SIZE = 0x00080000;
  __EXT_FLASH = ADDR(.ext_flash);
  __EXT_FLASH_SIZE = 0x00200000;
  }
    
   
  Thank you 
  Regards,
  Vika 

Carlos O'Donell <carlos at codesourcery.com> wrote:
  On Mon, Jan 22, 2007 at 03:09:26PM -0800, vika vika wrote:
> Carlos and Kazu Thanks for your help
> 
> I put dummy functions for that all undefined functions ...I am not using
> any std. OS so I have implemented malloc (not using sbrk) and printf
> (serial port ). I will also Ref your linker file.
> 
> Thank you
> Vika

I'm glad we could be of help! Feel free to email the list if you have
any other problems.

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos at codesourcery.com
(650) 331-3385 x716


 
---------------------------------
8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20070123/e6539a03/attachment.html>


More information about the coldfire-gnu-discuss mailing list