In article <LL************************@newssvr10.news.prodigy .com>,
Thomas Matthews <Th**************************@sbcglobal.net> wrote:
There are times when a function needs to be in one location for
execution, but reside in another.
One example is programming a Flash Memory. The functions for
programming a Flash memory can reside in the Flash. However,
many Flash's do not support simultaneous execution (read) and
programming. Because of this, the code to program the Flash
must be relocated before it is executed. ...
As far as I have researched (and I did post to this newsgroup)
there is no method to copy a function from one location to
another. There is no standard method for obtaining either
the length of a function nor its ending address.
Indeed, this is quite the case. Not only is there no Standard
(as in C89 or C99) method, neither is there a standard (as in
"de facto" / "this works on almost every system") method.
Many, if not most, C systems that target "freestanding" environments
-- partiuclarly those where the code is written on System A but
run on Completely Different System B, such as "written on Unix-clone"
and "run on microwave oven" -- have quite fancy linkers. Many of
these can even be instructed to link code to *load* at location X
yet *run* at location Y.
Unfortunately, the exact set of instructions varies from one linker
to the next. So you need a system- or even linker-specific newsgroup
to talk about this (otherwise you will get wrong answers, and nobody
will even know they are wrong).
--
In-Real-Life: Chris Torek, Wind River Systems (BSD engineering)
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it
http://67.40.109.61/torek/index.html (for the moment)
Reading email is like searching for food in the garbage, thanks to spammers.