I need to port some older 68K programs to Coldfire. The original programs were developed with a different toolset so this migration is complicated by tool differences as well as target differences.
Our custom boards use a boot loader that expects the program to start from address 0x4004. My problem is that the linker always places vector table "_vect" at the start of the code segment. I redefined the code segment in the linker file to start earlier so that the _startup routine would begin at 0x4004. Unfortunately this approach causes the vectortable to overwrite an area used by the boot loader. Also, location 0x4000 is used to store a checksum value that is verified by the boot loader so moving the code segment such that vector 1 resides at 0x4004 doesn't work either. Changing the boot loader is not an option my management will consider. Is there a way to tell the linker to place the vector table "_vect" array in another area other than the start of the code segment? I experimented with the "#pragma define_section vectortable ".vectortable" far absolute R" directive with no success.
Solved! Go to Solution.
After struggling with this yesterday I just found the answer. The linker file ".vectors" section is defined to be placed in the code segment. I revised this to place it in another segment and that moved it.
As always, once I ask for help I seem to blindly stumble onto the answer. Thanks, anyway.
M
After struggling with this yesterday I just found the answer. The linker file ".vectors" section is defined to be placed in the code segment. I revised this to place it in another segment and that moved it.
As always, once I ask for help I seem to blindly stumble onto the answer. Thanks, anyway.
M