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 |
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.
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.
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.
This note is only applicable to programs with the following characteristics:
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.
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.
Usage:
As an extension to the new features implemented for BIN18-72, now MPLINK has made available:
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.
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):
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):
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.oHowever, 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'.
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.
LIST P=12C508 CODE 0x100 MOVLW 0 MOVLW 1 MOVLW 2 MOVLW 3 ENDAfter 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 FFThe data record shows the instruction 'MOVLW 3' at address 0x103, but 0x103 was not specified in the range.
Error - unknown switch: /rUse the /h option instead.