--__--__--

Message: 1
Date: Wed, 02 Mar 2005 19:19:47 +0530
From: "Amol Khiste" <[email protected]>
To: <[email protected]>
Subject: [Mspgcc-users] Setting code location
Reply-To: [email protected]

mspgcc provides a variable - _etext - to mark the end of .text section. Is 
=
there any way to set the beginning of this section? I am porting code =
written with IAR to mspgcc. The code has following statement in the =
LNK430.xcl file:
-Z(CODE)CODE,CDATA0,CONST,CSTR,CCSTR#2A00-FFDF
which gives a different code location.

--__--__--

Hi Amol,


for porting IAR code to mspgcc i use the following snips

In my own linker file: 
-------8<---------
MEMORY
{
[..]
  IAR_GDATA(rw)         : ORIGIN = 0x1200,  LENGTH = 0x0400
  text   (rx)           : ORIGIN = 0x1600,  LENGTH = 0xCA00
[..]
}
-------8<---------


and further down in the SECTIONS area:
-------8<---------
  .IAR_GDATA  :
  {
    *(.IAR_GDATA)
    . = ALIGN(2);
    *(.IAR_GDATA.*)
  }  > IAR_GDATA
-------8<---------


in my code this looks like:
-------8<---------
#ifndef __GNUC__
   #pragma memory = constseg ( GDATA )
#endif

#ifdef __GNUC__
   __attribute__((section(".IAR_GDATA")))
#endif

const gDefaults gDefCh1 = {
[...]
-------8<---------


The line in the MEMORY area
        text   (rx)           : ORIGIN = 0x2A00,  LENGTH = 0xD5E0
would match to your
        -Z(CODE)CODE,CDATA0,CONST,CSTR,CCSTR#2A00-FFDF



Ciao,
          Helmut



Reply via email to