Keil Logo

LX51: Fixup Error in Library with MERGEPUBLICS


Information in this knowledgebase article applies to:

  • LX51 Linker/Locator Version 4.40 or higher
  • L251 Linker/Locator Version 4.40 or higher

SYMPTOM

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 no source code, I cannot locate the reason of the FIXUP Error.

CAUSE

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.

RESOLUTION

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 partially included after your library.

MORE INFORMATION

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.