Linker *.prm File (for the Cosmic compiler) and Linker *.prm File (for this compiler)

Cosmic uses a *.prm file for the linker with a special syntax. This compiler uses a linker parameter file with a *.prm file extension. The syntax is not the same format, but most things are straightforward to port. For this compiler, you must declare the RAM or ROM areas in the SEGMENTS...END block and place the sections into the SEGMENTS in the PLACEMENT...END block.

Make sure that all your segments you declared in your application (through #pragma DATA_SEG, #pragma CONST_SEG, and #pragma CODE_SEG) are used in the PLACEMENT block of the linker prm file.

Check the linker warnings or errors carefully. They may indicate what you need to adjust or correct in your application. E.g., you may have allocated the vectors in the linker .prm file (using VECTOR or ADDRESS syntax) and allocated them as well in the application itself (e.g., with the #pragma CONST_SEG or with the @address syntax). Allocating objects twice is an error, so these objects must be allocated one or the other way, but not both.

Consult your map file produced by the linker to check that everything is correctly allocated.

Remember that the linker is a smart linker. This means that objects not used or referenced are not linked to the application. The Cosmic linker may link objects even if they are not used or referenced, but, nevertheless, these objects may still be required to be linked to the application for some reason not required by the linker. In order to have objects linked to the application regardless if they are used or not, use the ENTRIES...END block in the linker .prm file:

  ENTRIES /* the following objects or variables need to be linked even if not referenced by the application */ 
  
  _vectab ApplHeader FlashEraseTable 
  
  END