Hello Jerry,
glad to hear it’s reproducible consistently
As soon as I have some more night-time available, I’d like to rewrite the hairy stuff using explicit addressing in the linker - and maybe have a peek at backporting it also to IAR4.
It’s quite easy: modify LIB assembler function in
SECTION `.exports_table`:CODE:NOROOT(2)
THUMB
__APP_Start ;void __APP_Start(void)
B 0x08010cd1
and add the following lines to the .icf Ilink control file:
define symbol _exports_TABLE__ = 0x08007211;
place at address mem:_exports_TABLE__ { readonly section .exports_table };
The imports addresses in APP can then be adjusted to the correct offset from the table start at 0x08007211 (that’s the current address of __APP_Start for IAR5, but of course if you are explicit with Ilinker you can place it where you like).
Inside APP you should then do something along the same lines in order to make sure the linker always places main() at address 0x08010cd1 (again, you can then choose whatever and simply adjust the above declaration in LIB accordingly).
I still don’t know how the same could be achieved with IAR4, but it is surely possible.
Will you have time to start the SVN repository? It would be way easier to supply patches, then. And maybe BenF would be so kind as to go on contributing his code on a more regular basis
Antonio