<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>&amp;quot;improper fixup&amp;quot; linking error caused by load and store library routines?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/15040/improper-fixup-linking-error-caused-by-load-and-store-library-routines</link><description> Hi, 
 
It seems as if the load and store library routines used by the C51 compiler (see http://www.keil.com/support/docs/1964.htm for a description of these routines) are the cause of an &amp;#39;improper fixup&amp;#39; error I&amp;#39;m getting while linking. I&amp;#39;m using the</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: "improper fixup" linking error caused by load and store library routines?</title><link>https://community.arm.com/thread/149107?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2002 13:29:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:115aa6ab-3aa9-4993-917a-cbcbd1cf1a73</guid><dc:creator>Jon Young</dc:creator><description>&lt;p&gt;I believe that StateTest (and maybe others) are required to be located at fixed locations.  Setting code to 0x4005-0x47FF on the linker tab and adding&lt;br /&gt;
&lt;pre&gt; 
CODE(?CO?StateTest(0x4005))
&lt;/pre&gt;
to the misc tab gives an duplicate keyword error.&lt;br /&gt;
&lt;br /&gt;
Using CODE(0x4005-0x47FF, ?CO?StateTest ) fails.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "improper fixup" linking error caused by load and store library routines?</title><link>https://community.arm.com/thread/134087?ContentTypeID=1</link><pubDate>Sun, 28 Apr 2002 23:36:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2bd537a1-e06b-4e99-ba32-b2877f6c9ca9</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;&lt;i&gt;There is something wrong with the linker however, because the following should have also worked but fails.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Nope.  There is nothing wrong with the linker.&lt;br /&gt;
&lt;br /&gt;
If you take a look at the original posting, the ROM(SMALL) directive tells the linker that you will have all of your program code reside within one 2K block.  So, the linker uses AJMPs and ACALLs.&lt;br /&gt;
&lt;br /&gt;
Since the CODE linker directive is used to change the starting address of the program, but only SOME segments are included, the linker locates all other segments starting at 0.&lt;br /&gt;
&lt;br /&gt;
The appropriate thing to do would have been to specify that the CODE area resides from 0x4000-0x47FF rather than manually locating segments in that range.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "improper fixup" linking error caused by load and store library routines?</title><link>https://community.arm.com/thread/121751?ContentTypeID=1</link><pubDate>Sat, 27 Apr 2002 06:27:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e1635f4f-2025-4196-8f7f-348256ac6ab1</guid><dc:creator>Jon Young</dc:creator><description>&lt;p&gt;I am using 8052 All Variants device.&lt;br /&gt;
&lt;br /&gt;
The following should work without worrying about wild carding all all the segments.&lt;br /&gt;
&lt;pre&gt;
  CODE( 0x4005, ?CO?StateTest(0x4005) )
&lt;/pre&gt;
&lt;br /&gt;
There is something wrong with the linker however, because the following should have also worked but fails.&lt;br /&gt;
&lt;pre&gt;
  CODE( 0x4005, ?CO?StateTest )
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "improper fixup" linking error caused by load and store library routines?</title><link>https://community.arm.com/thread/85111?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2002 23:12:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:79babb4d-3597-487c-a8b3-593960821b85</guid><dc:creator>Slarti Bartfast</dc:creator><description>&lt;p&gt;The solution lies in changing the CODE linker directive from:&lt;br /&gt;
&lt;br /&gt;
CODE(?CO?StateTest(0x4005), ?PR?*)&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
CODE(?CO?StateTest(0x4005), ?PR?*, ?C?*)&lt;br /&gt;
&lt;br /&gt;
so that the linker knows to put the library included by the compiler in the same 2Kbyte block as the rest of the code.&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Slarti&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "improper fixup" linking error caused by load and store library routines?</title><link>https://community.arm.com/thread/84257?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2002 17:19:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fac75957-fb9b-407f-8135-f30fd81355fe</guid><dc:creator>Slarti Bartfast</dc:creator><description>&lt;p&gt;I&amp;#39;m using:&lt;br /&gt;
&lt;br /&gt;
C51 COMPILER V6.14&lt;br /&gt;
BL51 BANKED LINKER/LOCATER V4.14&lt;br /&gt;
&lt;br /&gt;
-slarti-&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "improper fixup" linking error caused by load and store library routines?</title><link>https://community.arm.com/thread/54360?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2002 17:12:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ac0e1589-6ade-497b-ba7d-8998ba2a2adc</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;What version of the C compiler are you using?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: "improper fixup" linking error caused by load and store library routines?</title><link>https://community.arm.com/thread/38664?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2002 14:34:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8da55121-0a56-4133-b9da-8bc0233cd4b6</guid><dc:creator>Slarti Bartfast</dc:creator><description>&lt;p&gt;Here&amp;#39;s the error I&amp;#39;m getting:&lt;br /&gt;
&lt;br /&gt;
==========================================&lt;br /&gt;
*** ERROR L121: IMPROPER FIXUP    MODULE:&lt;br /&gt;
D:\PROJECTS\PUSHPIN\CODE\VERSION3\TESTCODEV3\STATETEST\STATETEST.OBJ&lt;br /&gt;
(STATETEST)&lt;br /&gt;
&amp;gt;&amp;gt;     SEGMENT: ?PR?_UPDATE?STATETEST&lt;br /&gt;
    OFFSET:  000AH&lt;br /&gt;
==========================================&lt;br /&gt;
&lt;br /&gt;
And here&amp;#39;s the part of the listing file of interest:&lt;br /&gt;
&lt;br /&gt;
===========================================&lt;br /&gt;
&lt;br /&gt;
             ; FUNCTION _update (BEGIN)&lt;br /&gt;
                                           ; SOURCE LINE # 23&lt;br /&gt;
;---- Variable &amp;#39;arg1&amp;#39; assigned to Register &amp;#39;R4/R5&amp;#39; ----&lt;br /&gt;
;---- Variable &amp;#39;arg0&amp;#39; assigned to Register &amp;#39;R6/R7&amp;#39; ----&lt;br /&gt;
                                           ; SOURCE LINE # 24&lt;br /&gt;
0000 850082      R     MOV     DPL,statePtr+01H&lt;br /&gt;
0003 850083      R     MOV     DPH,statePtr&lt;br /&gt;
0006 E4                CLR     A&lt;br /&gt;
0007 75F001            MOV     B,#01H&lt;br /&gt;
000A 1100        E     ACALL   ?C?IILDX&lt;br /&gt;
                                           ; SOURCE LINE # 25&lt;br /&gt;
000C EF                MOV     A,R7&lt;br /&gt;
000D 2D                ADD     A,R5&lt;br /&gt;
000E FF                MOV     R7,A&lt;br /&gt;
000F EE                MOV     A,R6&lt;br /&gt;
0010 3C                ADDC    A,R4&lt;br /&gt;
0011 FE                MOV     R6,A&lt;br /&gt;
                                           ; SOURCE LINE # 26&lt;br /&gt;
0012         ?C0001:&lt;br /&gt;
0012 22                RET&lt;br /&gt;
             ; FUNCTION _update (END)&lt;br /&gt;
&lt;br /&gt;
============================================&lt;br /&gt;
&lt;br /&gt;
It&amp;#39;s the ACALL to ?C?IILDX that seems to be causing the error.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
Slarti&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>