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]

RE: startup embedded target


Bill,

I have found a few of my problems, which I will explain here:

Long time ago, before I was subscribed to the mailing list, I also tried to
make a m68k-coff crosscompiler, following
http://sources.redhat.com/ml/crossgcc/2000-q2/msg00195.html. 
(please do read it, it will become clear very soon why my memory was so
messed up).

In that document, which is 'good' if u just want to learn about compilers or
about m68k assembly language, the problem for the 'make'-errors was to
change the gcc source-code itself.  But it is not really the way to go when
you want a 100% customizable compiler.

It uses its own default bcc.ld which is for some specific board. And it's
not possible to 'add' or replace it with an own linker-script.

I have re-made the m68k-coff GCC using the steps laid out by your script.
Now it is finally doing what I want it to do. But i'm still having little
problems dividing the target's memory.

For example:
I have somewhere in my code : unsigned int rand1 = 0x34fb;
and in my 'random' routine, it uses this number to make a new (pseudo)
random number.

When compiling, the linker puts rand1 in the 'rom1' section. But this
doesn't work, because I have to update that 'seed' value every time I call
my "random()" routine.
(i want to make the LEDs flash random values).

But I think this is a bit to be expected. The compiler/linker does not know
my target, only some regions where to put certain things.

To be sure, i would like to ask where the linker would put the following
things :
(all globals)

unsigned int Rand1; 
(my guess is : .bss ??)

unsigned int Rand2=0x34fb;
(my guess is : .data ??)

#define QUICC_REGS 0x0501000
volatile struct Quicc_regb* Quicc_register=(struct Quicc_regb*) QUICC_REGS;
(my guess is : .data ??)

So would you solve the problem with intialized variables that will be
changed later in the program ?

Kind regards, 
Jan

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


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