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

Error L103 - External attribute do not match public symbol..

Hello, I am getting the following error when I am trying to link my project:

*** ERROR L103: EXTERNAL ATTRIBUT DO NOT MATCH PUBLIC
    SYMBOL:  ?_s_denormalise?BYTE
    MODULE:  .\rsa_modexp.obj (RSA_MODEXP)


What can be the possible causes of this error? I looked at the discussion at
http://www.keil.com/support/docs/1742.htm

But there is a difference between the situation illustrated there and mine. First of all, my symbol is not a variable but a segment name for the function s_denormalise written in assembly language. Secondly, I am not declaring this function as extern. I have this .A51 source file containing the implementation of s_denormalise and I have a header file(.h) containing the prototype declaration of s_denormalise. I am including this header file in my rsa_modexp.c file and using the function. Then how does this explanation accounts for my case?

If there can be any other cause for this error, please let me know.

Thanks and Regards,
venkat.

Parents
  • Thanks Neil, for a prompt reply..

    Now I realize the 'extern' thing there. What you said is absolutely right. The parameter calling conventions are not the same for Keil's C51 and the assembly code I have. I observed that another function which has only three parameters did not have this problem(C51 passes a maximum of three parameters on registers and others in fixed memory locations). Now it is clear that only functions whose parameters are being passed in memory locations are causing the problem(s_denormalise for instance).

    I did as you suggested - I produced the SRC file using SRC directive and here is what I got in the SRC file correponding to my C file:

            EXTRN   CODE (_s_denormalise)
            EXTRN   XDATA (?_s_denormalise?BYTE)
    
    


    Clearly, the memory locations in which C51 is passing parameters are in XDATA. And in my SDENORM.A51(which contains the implementation of s_denormalise)the following is the declaration of the segment:

    NAME    SDENORM
    
    ?PR?_s_denormalise?SDENORM      SEGMENT CODE
    ?DT?_s_denormalise?SDENORM      SEGMENT DATA OVERLAYABLE
    
    PUBLIC  ?_s_denormalise?BYTE
    
            RSEG    ?DT?_s_denormalise?SDENORM
    ?_s_denormalise?BYTE:
    Rn_addr:        DS      1
    Rn_length:      DS      1
    Nn_addr:        DS      2
    d_addr:         DS      2
    d_length:       DS      1
    

    My suspicion is that "?DT?s_denormalise?SDENORM" indicates that segment(and hence the parameters stored in it) are present in DATA memory which is conflicting with XDATA as declared in my C file. If can change the assembly file by replacing all 'DT's by 'XD's and DATA by XDATA and all mov instructions by movx instructions will I be able to generate compatibility between my C file and the assembly code? It is a bit lengthy process to change all mov instructions to movx since the file is large. So, I seek your advice before I embark on it.

    Thanks again,
    venkat.

Reply
  • Thanks Neil, for a prompt reply..

    Now I realize the 'extern' thing there. What you said is absolutely right. The parameter calling conventions are not the same for Keil's C51 and the assembly code I have. I observed that another function which has only three parameters did not have this problem(C51 passes a maximum of three parameters on registers and others in fixed memory locations). Now it is clear that only functions whose parameters are being passed in memory locations are causing the problem(s_denormalise for instance).

    I did as you suggested - I produced the SRC file using SRC directive and here is what I got in the SRC file correponding to my C file:

            EXTRN   CODE (_s_denormalise)
            EXTRN   XDATA (?_s_denormalise?BYTE)
    
    


    Clearly, the memory locations in which C51 is passing parameters are in XDATA. And in my SDENORM.A51(which contains the implementation of s_denormalise)the following is the declaration of the segment:

    NAME    SDENORM
    
    ?PR?_s_denormalise?SDENORM      SEGMENT CODE
    ?DT?_s_denormalise?SDENORM      SEGMENT DATA OVERLAYABLE
    
    PUBLIC  ?_s_denormalise?BYTE
    
            RSEG    ?DT?_s_denormalise?SDENORM
    ?_s_denormalise?BYTE:
    Rn_addr:        DS      1
    Rn_length:      DS      1
    Nn_addr:        DS      2
    d_addr:         DS      2
    d_length:       DS      1
    

    My suspicion is that "?DT?s_denormalise?SDENORM" indicates that segment(and hence the parameters stored in it) are present in DATA memory which is conflicting with XDATA as declared in my C file. If can change the assembly file by replacing all 'DT's by 'XD's and DATA by XDATA and all mov instructions by movx instructions will I be able to generate compatibility between my C file and the assembly code? It is a bit lengthy process to change all mov instructions to movx since the file is large. So, I seek your advice before I embark on it.

    Thanks again,
    venkat.

Children