This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Initialized const at fixed location?

Hi!

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 linker option CODE(?CO?*,?PR?*,?C*,?CO?LAST,?CO?LANGUAGETREE(C000H))
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?

yours,

Christian Treczoks