26-Jul-2007 13:27 GMT
Initialized const at fixed location?
I've got a piece of source in my current project which represents
a balanced binary tree, built from a load of preinitialized structs
in C. All that needs to be visible from the "outside" is one symbol
("LanguageTree_Root"), everything else is static, and of no concern
to the other modules.
I managed to nail the module at a fixed location in code memory
(One should be able to replace the whole structure without the need
to reprogram the program code), but I just can't nail the one symbol
for the LanguageTree_Root to a fixed address (which should be the
beginning of the block).
The documentation tells me that using the _at_ keyword is not
possible for a pre-initialised variable, but without
pre-initialisation, the LanguageTree_Root pointer in code space is
worthless, even if i can nail it to a fixed address...
To bring the module to the proper location I already use the
which places the "normal" code stuff and constants at the beginning,
one "Last" module at the very end of the code, and the LanguageTree
module at location 0xC000.
The LanguageTree_Root symbol ends up "somewhere" in the 0xC0000,
but I just can't get it to the beginning.
Any ideas that might help me?