wait wait wait....
mspgcc generates position independent code within a function.
Only if you want to copy to ram more than two functions, you will need
pc-relative calls and such.
I am planning add this feature to gcc-4, but now you can do the following:
1. Rearrange you code the way that only one function has to be copied to
ram. Or
2. every function call program via inline assembler: asm volatile ("call
funct");~d ----- Original Message ----- From: "Rick Jenkins" <[email protected]> To: <[email protected]> Sent: Friday, January 14, 2005 8:20 PM Subject: Re: [Mspgcc-users] Position-independent function call > My thanks to both the people who responded to my query. > > Rolf's suggestion is a good one, since it is easy enough to compute the new > address of a function after it has been moved. With -O2 it calls via a > register variable, and is completely position-independent. It has the minor > disadvantage of needing extra code to figure out the address of any > function to be called, and RAM space is dreadfully tight in the smaller > machines. > > Bill Knight's suggestion is excellent if the code is to be RAM-resident, > since it is completely transparent. However, my need is for code which is > not normally used, but is moved to RAM during a code update, to reprogram > the flash. With restricted RAM space it is not practical for me to leave the > code in RAM at all times. > > I'd still like to find a way to produce the PC-relative call, since it is a > perfect solution. If it exists as a legal opcode, surely there should be a > way to access it? > -- > Rick Jenkins <[email protected]> > Hartman Technica http://www.hartmantech.com > Phone +1 (403) 230-1987 voice & fax > 221 35 Avenue. N.E., Calgary, Alberta, Canada T2E 2K5 > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Mspgcc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users
