ARM Technical Support Knowledge Articles

FIXUP ERROR IN LIBRARY WITH MERGEPUBLICS

Applies to: LX51 Linker/Locator

Answer


Information in this knowledgebase article applies to:


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

MORE INFORMATION

SEE ALSO

ATTACHED FILES

Request the files attached to this knowledgebase article.

Article last edited on: 2009-09-14 08:32:46

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential