This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

v6.20 problem?

Has anyone else tried C51 v6.20/uVision v2.20?

In one of my 'C' source files with inline assembler, the new Compiler
now creates an empty DATA Segment in the generated assembler. This
causes the Link to fail with Error L109, "Empty Relocatable Segment"

According to the online help & the PDF manual, L109 should not be a
fatal error; the Segment should simply be ignored.

So there are two issues here:
A. Why does the new compiler generate the empty Segment?

B. Why does the BL51 Link fail, when this should not be a Fatal error?
(the behaviour is the same for both the v4.14 & v4.20 Linkers).

Parents
  • I have found the reason for this problem I have been having. I noticed that the function was declared with the directive small (small memory model):

    ****************
    static void GenFac (unsigned char xdata *key, unsigned char xdata *fac_ptr) small
    ****************
    
    This means that the new compiler is making all the functions local variables "data space variables" as per the functions directive, but the declaration for the variable itself is creating an xdata segment.

    What then did the previous version of the compiler do?
    1) My guess is that it made the variable a data variable and did not create the xdata segment - and did not produce a warning / error that it was doing this?!? The linker would not have been able to pick that up since there was no (empty) xdata segment created...
    2) Alternatively the compiler made the variable xdata? So why only in the new compiler does it abide by these rules?

Reply
  • I have found the reason for this problem I have been having. I noticed that the function was declared with the directive small (small memory model):

    ****************
    static void GenFac (unsigned char xdata *key, unsigned char xdata *fac_ptr) small
    ****************
    
    This means that the new compiler is making all the functions local variables "data space variables" as per the functions directive, but the declaration for the variable itself is creating an xdata segment.

    What then did the previous version of the compiler do?
    1) My guess is that it made the variable a data variable and did not create the xdata segment - and did not produce a warning / error that it was doing this?!? The linker would not have been able to pick that up since there was no (empty) xdata segment created...
    2) Alternatively the compiler made the variable xdata? So why only in the new compiler does it abide by these rules?

Children
  • I have a large code settings for my project.
    The following code generated L109 error:

    typedef union tagLONGLONG{
    struct{
    unsigned short hi;
    unsigned long lo;
    } LL;
    unsigned char bytes[6];
    unsigned short words[3];
    } LONGLONG;

    void ZeroLONGLONG(LONGLONG xdata *v)
    {
    v->LL.hi=0; v->LL.lo=0;
    }


    This fix shuts down the error:
    void ZeroLONGLONG(LONGLONG xdata *v)
    {
    char xdata i; //dummy fix
    v->LL.hi=0; v->LL.lo=0;
    }