Release Notes for MPLINK™ Object Linker and Utilities v5.08
MPLINK Object Linker v5.08
MPLIB™ Object Librarian v5.07
MP2COD COFF to COD File Converter v5.08
MP2HEX COFF to HEX File Converter v5.08
13 September 2016

Table of Contents
  1. Important Backward Compatibility Notes
  2. What's New in v5.xx
  3. Changes introduced in v4.xx
  4. What's Been Fixed Since v4.30
  5. Command Line Device Options Supported
  6. Operating System Support List - MPLAB IDE
  7. Operating System Support List - MPLAB X IDE
  8. Known Problems
  9. Customer Support
  1. Important Backward Compatibility Notes

  2. New switch to reserve debug resources and IDE compatibility

    MPLINK v5.00 introduces a new command line option /r, which can be used to specify regions in data and program memory in which the linker should not allocate any object. MPLAB X IDE v2.00 and higher will make use of this new MPLINK option to reserve the program and data memory required for hardware debugging. MPLAB X IDE v2.00 and higher will also be able to work with older versions of MPLINK. However, in order to use MPLINK v5.00 or newer in any project that requires hardware debugging, upgrading to MPLAB X IDE v2.00 or higher is necessary.

    Linker Script Filename Case In Linux

    Prior to v3.46, few linker script filenames were in uppercase. MPLAB X projects using such devices failed to build on Linux based OS as MPLAB X used to specify the linker script using lowercase names. Starting from v3.46 of C18, all linker script filenames have been converted to lowercase to fix this issue.

    Users using their own custom scripts to build C18 or MPASM projects should change the filename of linker script in their custom scripts to lowercase. Otherwise they might encounter "Could not find Generic linker commands for this device" error during the link stage. If the user does not wish to do this, then they can work around the issue by creating a symbolic link to the new lowercase filename from the uppercase filename. A shell script called createbackcompatiblelinks has been provided in mpasmx folder on Linux to do the same. Depending on where the user's bin\LKR folder is located, root or super-user privilege might be required.

    COFF File Format Replaces COD File Format

    Due to the elimination of the COD Format from MPASM ouput, and the use of COFF format instead, new flags have been added to COFF files that are generated by C18 v3.30 and MPASM v5.30. These flags are only recognized by MPLINK v4.30 and above. MPLINK v4.30 and above continue to recognize the old COFF files. However, earlier versions of MPLINK may not recognize new COFF files.

    Corrected behavior for programs with no high priority Interrupt Service Routine (ISR) due to removal of the vectors region from linker scripts (BIN18-70)

    This note is only applicable to programs with the following characteristics:

    1. Explicitly defined low priority ISR and
    2. No defined high priority ISR and
    3. Has the High priority interrupt enabled (either explicity or by not disabling the default)

    In the previous versions of the linker scripts (with the vectors region), no code or data was being placed between the High/Low-priority interrupt vectors. Consequently, with the arrival of a High-priority interrupt, the execution of the program would (erroneously) fall into the low-priority ISR. With the removal of the vectors region from the linker scripts, other data or code may be placed at the addresses between the High and Low priority interrupt vectors. This results in a non-deterministic behavior, upon the arrival of a high priority interrupt for these programs.

    MPLINK Linker and MPLAB IDE Compatibilty

    Due to a change in COFF file format, MPLAB C18 v3.00 and later will not be compatible with versions of MPLINK Linker prior to v4.00 or versions of the MPLAB IDE prior to v7.21.

    MPLINK Linker v4.00 and later will have backward compatibility to earlier versions at the source level only. Any existing object files or libraries compiled with earlier versions of the tools will not link using new versions of the tools. They will need to be recompiled from source.

    If the user attempts to use this release with object files or libraries compiled with earlier versions of MPLAB C18, MPLINK Linker, and MPASM Assembler, the error message that will be received will be similar to:

    Error - Coff file format for 'C:\mcc18\lib/c018i.o' is out of date.
    

    If the user attempts to use an old version of MPLINK Linker to link object files or libraries compiled with this release, the error message that will be received will be similar to:

    Error - Coff file format for 'C:\mcc18\lib/c018i.o' does not appear to be a valid COFF file.
    
  3. class="Heading0">

    What's New in v5.xx


      • Introduced in v5.00
      • New command-line option to reserve data and program memory.
        The new /r command line option introduced in v5.00 allows the user or IDE to reserve data and program memory regions. MPLINK will not allocate any objects in the the memory range specified using the /r option.

        Usage:

      • To reserve program memory:
        -r=ROM@<start address>:<end address>
        Where, <start address> and <end address> are in hex format with 0x prefix

      • To reserve data memory:
        -r=RAM@:<start address>:<end address>
        Where, <start address> and <end address> are in hex format with 0x prefix
        <qualifier>: could be GPR: or ACCESS: or SHARE: and is optional

      • This option is used by the MPLAB X IDE v2.00 and higher to reserve the program and data memory regions required by some hardware debuggers during debugging.
  4. Changes introduced in v4.xx


      • Early adopter part support has been added. See "Devices" below.


      • Old linker scripts will no longer be included in new installations. Only the generic linker scripts will be included. For example, 18F4550.lkr, 18F4550i.lkr, 18F4550_e.lkr and 18F4550i_e.lkr (which would be found under MCC18/lkr for the compiler) will no longer be installed. Instead, only 18F4550_g.lkr will be installed (which can be found under MCC18/bin/LKR for the compiler).
        Note: Installing over an older installation will not remove the old linker scripts, but updates will only be made to the new generic linker scripts.

      • The following beta devices have been renamed from "L" devices to "LF" devices:
        18L13K22 to 18LF13K22
        18L13K50 to 18LF13K50
        18L14K22 to 18LF14K22
        18L14K50 to 18LF14K50
        18L24J11 to 18LF24J11
        18L24J50 to 18LF24J50
        18L25J11 to 18LF25J11
        18L25J50 to 18LF25J50
        18L26J11 to 18LF26J11
        18L26J50 to 18LF26J50
        18L44J11 to 18LF44J11
        18L44J50 to 18LF44J50
        18L45J11 to 18LF45J11
        18L45J50 to 18LF45J50
        18L46J11 to 18LF46J11
        18L46J50 to 18LF46J50

      Introduced in v4.22 from BIN18-72
      Request for new #define and #if/else style directives for linker scripts.

      As an extension to the new features implemented for BIN18-72, now MPLINK has made available:

      1. /p command-line flag allows the user or IDE to define the part number for the linker. If this flag is used, MPLINK will select the correct generic linker script from the lkr directory relative to the location of the executable and use it to build the project.
      2. /u command-line flag allows the user or IDE to define symbols that will be used by the linker to resolve the conditional directives inside the linker script. For more details on this please refer to the MPASM Assembler,MPLINK Object Linker, MPLIB Object Librarian User's Guide (DS33014).
      3. Customized Linker Scripts:
        1. The existing (old) linker scripts will be removed (in the future) from the distribution tree and only the generic linker scripts will be supported. The existing projects with local linker scripts will continue to work and user can decide if they want to use their local linker script or just eliminate it and let the linker to use the generic one. However, regarding the projects that use the default linker script, we recommend that users move to the new paradigm of not having any linker script.
        2. Customization of linker scripts is no different than before. Users can use their existing linker script or take a generic linker script and apply their modifications, and include it in their project. For more details on how to do this modification please refer to the MPASM Assembler,MPLINK Object Linker, MPLIB Object Librarian User's Guide (DS33014).
      4. Generic Linker Scripts:
        Using the conditional directives, now a single generic linker script, per device, replaces the various existing linker scripts, eliminating the need for an explicit selection of a linker-script inside the MPLAB projects. Through the /p and /u command-line flags, the IDE communicates the part number and different debug and part specific information to MPLINK. Accordingly, MPLINK selects the proper generic linker script and uses it to link the entire project. Any combination of the following build possibilities will automatically be handled without the user needing to worry about linker scripts:
        1. Build for debug or no debug for various debuggers
        2. Build for C or assembly only projects
        3. Build for extended or traditional mode (for PIC18)
  5. What's Been Fixed Since v4.30:


    1. Problems resolved between v5.06 and v5.07:

      None


    2. Problems resolved between v5.05 and v5.06:

      None


    3. Problems resolved between v5.04 and v5.05:

      None


    4. Problems resolved between v5.03 and v5.04:

      None


    5. Problems resolved between v5.02 and v5.03:

      None


    6. Problems resolved between v5.01 and v5.02:

      None


    7. Problems resolved between v5.00 and v5.01:

      None


    8. Problems resolved between v4.51 and v5.00:

      (BIN18-160)
      In mplink v4.51, using -m option results in hex file corruption if BANKSEL directive is used


    9. Problems resolved between v4.50 and v4.51:

      None


    10. Problems resolved between v4.49 and v4.50:

      None


    11. Problems resolved between v4.48 and v4.49:

      None


    12. Problems resolved between v4.47 and v4.48:

      None


    13. Problems resolved between v4.46 and v4.47:

      None


    14. Problems resolved between v4.45 and v4.46:

      None


    15. Problems resolved between v4.44 and v4.45:

      None


    16. Problems resolved between v4.43 and v4.44:

      None


    17. Problems resolved between v4.42 and v4.43:

      None


    18. Problems resolved between v4.41 and v4.42:

      None


    19. Problems resolved between v4.40 and v4.41:

      None


    20. Problems resolved between v4.39 and v4.40:

      (BIN18-134)
      MPLINK fails to link the 16f630 project

      (BIN18-142)
      Flash Memory is not defined in the linker scripts

      (BIN18-143)
      Flash Memory information is missing in the linker script for 16F526

    21. Problems resolved between v4.38 and v4.39:

      (BIN18-135)
      Make MPLINK display resource file version number in version banner

    22. Problems resolved between v4.37 and v4.38:

      (BIN18-132)
      Linker CODEPAGE .config end address for 16F88/16F87 Family changed from 0x2009 to 0x2008.

    23. Problems resolved between v4.36 and v4.37:

      None


    24. Problems resolved between v4.35 and v4.36:

      (BIN18-116)
      Need to add RESERVED keyword to the linker script

      (BIN18-122)
      Correct the end address for eedata in the linker script for 16F882.

      (BIN18-124)
      MPLINK does not recognize MCP250XX

    25. Problems resolved between v4.34 and v4.35:

      (BIN18-4)
      MPLIB truncates filenames containing a forward-slash path delimiter

      (BIN18-110)
      Add /i command line option description to MPLINK help documentation

      (BIN18-114)
      Enable linker to also search the linker script at {linkerexepath}../lkr and linkerexepath}../LKR by default.

      (BIN18-115)
      For midrange devices, the one byte used by debug executable is not safe

      (BIN18-117)
      idloc locations are not PROTECTed in the device 16F877

    26. Problems resolved between v4.33 and v4.34:

      (BIN18-104)
      Internal Coff output file is corrupt, error is generated when the code has empty code and data sections

      (BIN18-108)
      Add support to allocate large objects (size more than one bank size) in Linear Memory for enhanced midrange devices (PIC16F193x).

    27. Problems resolved between v4.32 and v4.33:

      (BIN18-107)
      MPLINK fails to link for the device 18F86K95.

    28. Problems resolved between v4.31 and v4.32:

      None


    29. Problems resolved between v4.30 and v4.31:

      None


  6. Command Line Device Options Supported

  7. Click here for a complete listing.

    THE PARTS CORRESPONDING TO THESE OPTIONS MAY NOT ALL BE COMMERCIALLY AVAILABLE.

    The part selection is specified at assembly time and contained within the object file. An appropriate linker command file is necessary to properly link for the chosen part.

  8. Operating System Support List - MPLAB IDE

  9. MLINK.EXE is the 32-bit Windows version of MPLINK Object Linker which is distributed with MPLAB IDE and MPLAB C18. It is supported on the following platforms (32- and 64-bit):

    • Microsoft Windows XP Professional SP3/ Windows 7 Professional/ Windows 8 Professional
  10. Operating System Support List - MPLAB X IDE

  11. MLINK.EXE is the 32-bit version of MPLINK Object Linker which is distributed with MPLAB X IDE. It is supported on the following platforms (32- and 64-bit):

    • Microsoft Windows XP Professional SP3/ Windows 7 Professional/ Windows 8 Professional
    • Ubuntu 9.10
    • Macintosh OS X 10.5 Intel
  12. Known Problems

  13. (BIN18-3 / 22483)
    MPLIB is unable to work with MPLAB C18 files compiled in the static overlay model.
    For example, the source code:
            int add( int a, int b )
            {
               int c;
    
               c = a + b;
               return c;
            }
    
    can be compiled and archived with the commands:
            mcc18 test.c -sco
            mplib -c test.lib test.o
    
    However, attempting to list the files in the archive link the archive will result in the error:
            Error - Coff file 'test.o' could not read string table.
            Error - Could not build member 'test.o' in library file './test.lib'.
    
    (BIN18-5 / 3224)
    MPLINK Linker always links in the section which loads initialized data from program memory to data memory, even though it is not required.


    (BIN18-21 / 18214)
    If MPLINK.EXE is invoked without arguments, an error message stating "Error spawning _mplink.exe" is emitted. This message is spurious; it can be ignored.


    (BIN18-22 / 18432)
    An interrupt with locals of "overlay" storage class which calls a function reachable from main is incorrectly viewed as recursive.
    For example, the program:
            int g (void) {
              return 2;
            }
    
            void f (void);
            #pragma interrupt f
            void f (void) {
              overlay int x;
              x = g ();
            }
    
            void main (void) {
              int x;
              x = g ();
            }
    
    Will cause a linker error, stating that 'g' is recursive and has locals of "overlay" storage class. The workaround is to use "auto" instead of "overlay" in the interrupt.


    (BIN18-26 / 19225)
    MPLINK Linker may generate an assertion failure on programs which contain a section of zero length. The workaround is to remove such sections from the program.


    (BIN18-27 / 20403)
    The '/r' option of MP2HEX does not work correctly for ranges specified outside of any existing data.
    For example, given the following source, 't.asm':
            LIST P=12C508
            CODE 0x100
            MOVLW 0
            MOVLW 1
            MOVLW 2
            MOVLW 3
            END
    
    After assembly, execute 'mp2hex.exe t.o /r 0x104-0x104'. The hex file content is:
            :02 0000 04 0000FA
            :02 0206 00 030C E7
            :00 0000 01 FF
    
    The data record shows the instruction 'MOVLW 3' at address 0x103, but 0x103 was not specified in the range.
    Since no data exists at 0x104 in the COFF file, there should be no data bytes in the hex file.


    (BIN18-29 / 22228)
    Quiet mode (/q) disables the printing of errors and warnings to standard out.


    (BIN18-33 / 22947)
    The /? command-line option may give the following error message on Windows 2000:
            Error - unknown switch: /r
    
    Use the /h option instead.


    (BIN18-50 / 27314)
    Program memory utilization is not correct in map files generated for PIC18F87J10.


    (BIN18-53 / 28114)
    The linker may disregard the section information in the last IDATA due to CONFIG syntax directives.


    (BIN18-139)
    Linker error - "Cannot fit the section" seen with 12F675


  14. Customer Support


    Microchip provides online support via our home page at:
    http://www.microchip.com

    Technical support is available through the web site at:
    http://support.microchip.com

    A forum for discussion of Microchip products and tools is available at:
    http://forum.microchip.com