GCC Linkscript problem

Chris Johns chrisj at rtems.org
Fri May 16 21:31:39 UTC 2008


Steven Grunza wrote:
> It looks like my problems with the H8SX port are related to the
> start/linkcmds script.  
> 
> Does anyone know of a good reference on the subject?  The data that is
> supposed to be placed in the Flash and then copied into RAM by
> start/start.S appears to be getting put by GCC directly into the address
> range where RAM is supposed to be.  If I convert the s-record file into
> binary and then dump the binary I can see data in memory locations that
> are far above the end of the Flash.  

The normal way to handle this is to add an AT(LMA) to the SECTION command for 
you data section. You can read about it here:

http://www.delorie.com/gnu/docs/binutils/ld_33.html

Notice the example uses:

  .mdata 0x2000 :
      AT ( ADDR (.text) + SIZEOF (.text) )
      { _data = . ; *(.data); _edata = . ;  }

so the data is actually place just after the location of the .text section.

> 
> The short story is I made a mistake in the linkcmds file but I can't
> find any references on how to fix it.
> 


The LD manual is a good reference when using the GNU ld.

Regards
Chris



More information about the users mailing list