LX51: FIXUP ERROR IN LIBRARY WITH MERGEPUBLICS
Information in this knowledgebase article applies to:
I am combining several applications using incremental builds and the directive MERGEPUBLICS to save memory requirements. However I am now getting now FIXUP Errors in library modules.
The linker error message is:
*** ERROR L121: IMPROPER FIXUP MODULE: C:\KEIL\C251\LIB\C2SXSH.LIB (?C?SLDIV?) SEGMENT: ?C?LIB_CODE? OFFSET: 00001DH *** ERROR L121: IMPROPER FIXUP MODULE: C:\KEIL\C251\LIB\C2SXSH.LIB (?C?SLDIV?) SEGMENT: ?C?LIB_CODE? OFFSET: 000029H
Since I have not source code, I cannot locate the reason of the FIXUP Error.
The library is using short jumps (LJMP or LCALL) to optimize the application code size. However in the application that you include using MERGEPUBLICS the library is only partially included. Since the other application is not within the same 64KB segment, this part of the library cannot be reached using LJMP or LCALL instructions.
Add the library (in this example: C:\KEIL\C251\LIB\C2SXSH.LIB) that is causing the fixup error explicitly to the project before the application that is included with MERGEPUBLICS. Ensure that the library and the application are the last input files in the file list. When you are using µVision you may just drag and drop these files in the project window to the end of the project file list.
When the linker is processing a library file, it takes all the references that are open from other files from the library. It is therefore important that the application that is using the library partally included after your library.
Last Reviewed: Monday, September 14, 2009
of your data.