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

cannot figure out this link warning

I am using 5.20 if it matters

I have a function that is indirectly called from an array of functions. This function is contained in its own module. When I link, I get the following warning:

WARNING 16: Uncalled Segment, ignored for overlay process
segment: ?CO?FACT_CON

in this module I have one variable that I define as

static float code ideal_values[LAST_POINT] ={

if I change the "code" to "const" (or remove it entirely), it will link with no warnings, but now the variable is taking up XDATA, and with only 2K of it, XDATA is VERY precious...

I've also tried several other incantations of the same line of code. It either ends up in XDATA, or gives me the warning.

I've had this problem in several other places, but until now, I chosen to ignore it... any ideas? (if anyone thinks more info is needed, please ask, I just didn't want to flood the list with things like link maps, and other such things)

Parents
  • Okay, one thing you can try is the NOOL option for the linker. This makes all data non-overlay, so it may take up data space if you have automatic variables. If all your data is static, you will get little or no increase in data space, and the warning will go away.

    can't do this... I'd love to, but I only have 2K of SRAM with VERY little free.

    If you need to run in overlay mode, the other way to eliminate this warning is with the OVERLAY command in the linker.

    I have MANY entries into my link file in regards too this. They maybe wrong though.

    Regardless, I have it working now, after moving the variable INSIDE the function, the warning has disappeared. I have taken this concept to several other places in my code where such problems existed, and they too are now gone. (thanks to Mark for suggesting this to me... with only one function in the file, I orignally didn't care about localizing the scope as much as possible, because it just didn't matter.) I'd still like to know why this happenned, I hate ghosts.

Reply
  • Okay, one thing you can try is the NOOL option for the linker. This makes all data non-overlay, so it may take up data space if you have automatic variables. If all your data is static, you will get little or no increase in data space, and the warning will go away.

    can't do this... I'd love to, but I only have 2K of SRAM with VERY little free.

    If you need to run in overlay mode, the other way to eliminate this warning is with the OVERLAY command in the linker.

    I have MANY entries into my link file in regards too this. They maybe wrong though.

    Regardless, I have it working now, after moving the variable INSIDE the function, the warning has disappeared. I have taken this concept to several other places in my code where such problems existed, and they too are now gone. (thanks to Mark for suggesting this to me... with only one function in the file, I orignally didn't care about localizing the scope as much as possible, because it just didn't matter.) I'd still like to know why this happenned, I hate ghosts.

Children
  • This is just a suggestion.

    I declare an array of function pointers to solve similar problem in my current project. It works without warning, the array is placed in code memory, and the overlay analysis is used for the whole project.

    You could try this:

    static const float (code* code ideal_value[LAST_POINT])(void) = {fnct1, fnct2};

    This simply declare an array of pointers to functions that return float and take no argument. The array is placed in the code.

    Invoke the function by:
    x = ideal_value[i]();
    or
    x = (*ideal_value[i])();

    I hope this solve your problem.

    David Lin