This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Placing variables in RAM with define commands.


On Mon, Apr 22, 2002 at 11:37:14AM +0200, Johansson Mikael
(mj) wrote:
> > I'm trying to place variables in RAM on a M68040 using
> > the following commands placed in an include-file where
> > all global variables are placed.
> > 
> > For single variables int, float #define var (*( int * )(
> > hex adress ))
> > 
> > For arrays #define array (( int * )( hex adress ))
> > 
> > For arrays there is another approach typedef boolean
> > BOOLARRAY[8 - 1 + 1]; #define array (*( BOOLARRAY * )(
> > hex adress ))
> > 
> > Does anyone know which approach is preferred for arrays
> > and how to do with two-dimensional arrays.

That can't be the preferred solution at all. I am not a
specialist of linker scripts, but you'd be much better off
just defining your variables the way C intends and learn how
to link the bss section in RAM.
Something like:

<make all your *.o>
ld -o my_exec -Ttext <base for binary> -Tdata <base for data> *.p

HTH
/Yves

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]