How to place vectortable somewhere other than at the beginning of the code segment

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to place vectortable somewhere other than at the beginning of the code segment

Jump to solution
552 Views
MiataTexan
Contributor II

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.

Labels (1)
0 Kudos
1 Solution
364 Views
MiataTexan
Contributor II

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

View solution in original post

0 Kudos
1 Reply
365 Views
MiataTexan
Contributor II

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

0 Kudos