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

armlink Error: L6218E: Undefined symbol...

  • Note: This was originally posted on 6th July 2009 at http://forums.arm.com

    There are few complication in the code part to change it. Because these are legacy code. It would be a great help if some body provide the actual switch to eliminate the above [Error: L6218E:undefined symbol error...] kind of error during linking. 

    I have tried couple of option like --unresolced, --edit  and -- vfemode without any proper result. So, anybody have any proper switch option or any solution witout changing the code please share it.
  • Note: This was originally posted on 6th July 2009 at http://forums.arm.com

    Well, ... there is a compiler command line switch, "--split_sections", which causes it to put every function in its own section in the output object.

    If a function is not used the linker can then eliminate the whole section - which might work in your case.


    This *will* slow down your code, but might achieve what you want. If you want to fix the issue without the code slow down then see my first post about fixing the code - either via making functions static (and allowing internal optimization within the section), or by removing them from the compile completely. =)


    Well I have tried this option but sorry to say it's not working :(
  • Note: This was originally posted on 6th July 2009 at http://forums.arm.com

    You could just create and link with an additional C file/object that provides stubs for the non-existent functions your other C files are importing, e.g.

    int temp(void) { return 0; }
    int temp2(void) { return 0; }
    int temp3(void) { return 0; }


    hth
    s.


    Well let me put it in this way this temp function do have definitions in separate module. But as per project requirement those definition section should not used in this particular part of code. So, my requirement is to find an appropriate compiler switch to make the given code to be compilable without the linker error.
  • Note: This was originally posted on 6th July 2009 at http://forums.arm.com

    > In a C file if some function not used why RVCT generate symbol for that.

    If the function is static, then there won't be. Non-static functions are assumed to be exported so they are visible to other objects.

    You should ideally make non-exported functions in a translation unit static - they normally can be optimized more =)

    > I think there should be some compiler or linker switch to compress this kind of error or to instruct RVCT not to generate symbol for that.

    Or you could just fix the C code =)
  • Note: This was originally posted on 6th July 2009 at http://forums.arm.com

    Well, ... there is a compiler command line switch, "--split_sections", which causes it to put every function in its own section in the output object.

    If a function is not used the linker can then eliminate the whole section - which might work in your case.


    This *will* slow down your code, but might achieve what you want. If you want to fix the issue without the code slow down then see my first post about fixing the code - either via making functions static (and allowing internal optimization within the section), or by removing them from the compile completely. =)
  • Note: This was originally posted on 6th July 2009 at http://forums.arm.com

    > But as per project requirement those definition section should not used in this particular part of code.

    As far as the tools are concerned they *are* used, and you are telling the tools that they are exported (if the symbol of the function is not marked as static). So the tools cannot optimize this function out.

    > It would be a great help if some body provide the actual switch to eliminate the above

    I'm not sure there is a "magic" switch to make this error go away - it's a fatal error, and what you are trying to achieve isn't really how a typical compiler and linker is designed to work...
  • Note: This was originally posted on 6th July 2009 at http://forums.arm.com

    You could just create and link with an additional C file/object that provides stubs for the non-existent functions your other C files are importing, e.g.

    int temp(void) { return 0; }
    int temp2(void) { return 0; }
    int temp3(void) { return 0; }


    hth
    s.