|ARM Technical Support Knowledge Articles|
Information in this article applies to:
After making changes to a program or after adding in-line assembly improper fixup errors are generated by the linker. For example:
*** ERROR L121: IMPROPER FIXUP MODULE: NO_SP.obj (NO_SPEED1) SEGMENT: ?PR?MAIN?NO_SPEED1 OFFSET: 0099H
A fixup error is generated when it is impossible to generate an instruction address that reaches an operand. This is frequently the case with instructions that implement relative jumps or branches. Typically, improper fixups are caused by in-line assembly code that attempts to access an address that is too far away. The error message listed above was generated by a program that included in-line assembly.
You can easily find the assembler instruction that contains an improper fixup using the information provided by the error message. In the case of the error listed above...
0096 782D 609 MOV R0,#10 ; delay factor 10 0098 D800 F 610 DJNZ R0,0 ; count down delay 009A 7E08 611 MOV R6,#8
The problem is with the DJNZ instruction at offset 0099H. In this case, the DJNZ is attempting to jump to address 0000h but fails because relative jumps can only reach locations that are within a +/- 128 byte range.
Upon examination of the code at the point of the fixup error, it is aparent that a jump to 0000h was not intended. Instead a simple delay loop should be generated and the DJNZ instruction should jump to itself. This can be accomplished by changing the DJNZ instruction in the in-line assembly to DJNZ R0,$. After making this change, the assembler correctly inserts a jump to the DJNZ instruction and the linker no longer generates the fixup error.
Article last edited on: 2009-09-14 01:47:35
Did you find this article helpful? Yes No
How can we improve this article?