Menu

#1496 variable's address is linked difference with map file

closed-invalid
5
2013-05-25
2008-12-31
steven
No

I'm portting ucos to mcs51, but i get a trouble, please help me.

sdcc version :
2.8.4

Compiler option :
--std-sdcc99 --debug --model-large --iram-size 256

Source files :
OS_CORE.c, OS_CPU_A.c, OS_CPU_C.c, OS_MBOX.c, OS_MEM.c, OS_Q.c, OS_SEM.c, OS_TASK.c, OS_TIME.c, serial.c, yy.c
(All files are in attach file.)

Description:
Variable “OSRunning” defined in file “UCOS_II.H” line 300, after linked we can see it’s address is 0x6c on map file.
But in file “OS_CORE.c” line 529, Variable “OSRunning” is linked to on address 0x16, we can see this in binary file "ucos.ihx" line 81. Such as :
:0A0393007816E6705690001FE09007

Please help me.

Discussion

  • steven

    steven - 2008-12-31
     
  • Frieder Ferlemann

    Probably there's a problem with missing "extern" so OSRunning is defined (not declared) at several places.

    If you grep through the rst files:
    "grep OSRunning *.rst"
    you'll find several occurences of
    "_OSRunning::" and ".globl _OSRunning"
    (Note the trailing "::" )

    #ifdef OS_GLOBALS
    #define OS_EXT
    #else
    #define OS_EXT extern
    #endif

    ...

    OS_EXT idata BOOLEAN OSRunning;

    Seems like "OS_EXT" which depends on "OS_GLOBALS" which in turn depends on "OS_MASTER_FILE" is not set as expected.

    I renamed all source and header files to lowercase so that the filenames match the filenames used in the #include directives (on a case sensitive filesystem)

    Just a note: more comfortable than to look at the intel hex file's
    :0A0393007816E6705690001FE09007
    would be using the disassembler d52 ( http://www.8052.com/users/disasm/ ).
    Even more comfortable is looking at the rst files.

    Greetings,
    Frieder

     
  • steven

    steven - 2009-01-04

    thanks for your help and my ucos is running now.

     
  • Maarten Brock

    Maarten Brock - 2009-01-11
    • milestone: --> non_bugs
    • assigned_to: nobody --> frief
    • status: open --> closed-invalid
     

Log in to post a comment.

MongoDB Logo MongoDB