what is scatter file? what is its advantage? Kindly tell, i do not anything about these.
Thanks Sukhdeep Singh
well Andy, the thing that bothers me the most is the fact (as far as I could find in the documentation - somebody please do correct me if I'm wrong!) that the tool-chain has a very limited ability to integrate preprocessor stuff into a scatter file. That makes the code less maintainable due to obvious reasons.
If you need preprocessed scatter files, then I think you should write your own pre-link step.
... then, I suppose, you could feed them through the 'C' prepropcessor?
Remember: the so-called "C Preprocessor" actually knows nothing about the 'C' language or syntax - it is really just a text file processor.
I worked on a project once where the 'C' preprocessor was used to preprocess the linker scripts (althouh they weren't ARM scatter files).
I'll try to do that. thanks.
Not so.
The preprocessing phases of a C compiler do know quite a but about C syntax. The preprocessor parses character and string literals, integers and float constants, and it knows enough about identifiers and operators to notice that it should macro-expand only one instance of "E2" to 2E0 in the following snippet:
#define E2 2E0 0xA0E2+1.5E2+MILE2+E2_2+E2+sizeof('E2')+strlen("E2")
That goes well beyond "just a text file processor".
Please read the manual: Read The Fat Manual
infocenter.arm.com/.../Chdiehag.html
I use this on a daily basis to keep addresses that I might use in my code in sync with the scatter file.
Doing it the other way around, is also possible by accessing linker generated symbols (finding this in the manual is left as an exercise ;-). However, this has the downside that those values are not available at compile time and might cause extra memory accesses.
Regards Marcus http://www.doulos.com/arm/