On Thu, 2003-01-30 at 18:17, Fabrice Gautier wrote:
Hi,
It seems to me than when ROMRAM startup is choosen, the data section is
copied twice. (I've looked into integrator and ebdxxx platforms). The first
time in the platform specific code, along with the text section, and the
second time is in vector.S. This second time is need to copy the data
section in case of ROM startup.
Is there really a need to copy twice here ?
I think you're right although the copy of the DATA segment
is a no-op (bytes are copied over themselves). I'm sure
that the reason it was done this way was for simplicity.
Also, if there ever was a case where the memory layout
for a ROMRAM startup program did not have the DATA segment
immediately follow the TEXT, this code would have to be
executed. Doing it always relieves the code from knowing
if this is the case.
For large programs this could be very wasteful though.