This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

warning #10229-D: output section ".data" refers to load symbol "w2cFxn" and hence cannot be compressed; compression "rle" is ignored

Other Parts Discussed in Thread: CC3200-LAUNCHXL

I have the need to use a C++ class in my code. Hence I have changed the file where I am using this class from a .c to .cpp extension. (I have also tried the option "Treat C Files as C++ Files (--cpp_default, -fp)")

However, since doing this I am now receiving  the following error message. 

<Linking>

>> Compilation failure
warning #10229-D: output section ".data" refers to load symbol "w2cFxn" and hence cannot be compressed; compression "rle" is ignored

What can I do to resolve this issue? Or alternatively, what other ways can I use a C++ class in my C file?

  • The issue is not directly related to C++, it's related to the linker command file.  Please see the forum thread http://e2e.ti.com/support/development_tools/compiler/f/343/t/86954.aspx

  • Thanks Archaeologist,

    I have reviewed the post and it is not very clear to me what the resolution actually is.

    It states "The solution is to isolate the data structures which contain the problem symbols into a separate section.  This new section will not get compressed, but since it is small, it won't matter much."

    I develop in a number of languages and on a number of platforms, so being a compiler or linker expert is not really an option. Is it possible to explain the resolution in more detail, or point me in the direction of where I can find out more?

  • There is more than one way to address this problem; I'll explain the one you refer to.  Somewhere in your data, you have a global variable which refers to the address of w2cFxn, perhaps like so:

    int *ptr = &w2cFxn;

    Find that declaration and move ptr to a special section, with a name of your chosing:

    #pragma DATA_SECTION(ptr, "uncompressable_data")
    int *ptr = &w2cFxn;

    You will probably need to modify the linker command file to place "uncompressable_data" in the same place as ".data", like so:

    .data > MEM1
    uncompressable_data > MEM1
  • I have this same problem, but it is not from a variable. When I changed the main module of my project to a .cpp, it flags the task as being the problem. The only place this task name appears other than the declaration of the task is in the configuration of TI-RTOS.

    I moved the task out of the .c file into its own "c" file and the project now compiles. This is a temporary solution in that I need to make use of the c++ objects I have created within this task. I am worried that the task will become too large to not be compressed.

    What can I do to allow a task to be declared within a .cpp file and still allow it to be compressed? Thanks!
  • I'm not familiar with this specific problem. It would help to see the exact text of the error message.

    If any part of your program is C++, you really should compile the main function as a C++ function. Sometimes you can get away with compiling it as a C function, but it could lead to weird problems and it's best to just avoid those.

    When compiling a C++ file, the compiler does add some hidden variables and functions to support C++ features, but I wouldn't think that simply renaming the file would introduce such variables in a way that would cause this problem. Are you also adding class-typed objects when you change to a C++ file?

    In any case, if we're unable to eliminate the issue, you can always use the linker command file to separate the offending section into its own ouptut section; this output section would not be compressible, but it would be of minimal size, and the rest of the data would still be compressible. I'd have to see the exact text of the error message to suggest a change to the linker command file.
  • Hi,

      Thank you for the quick response.  Here is what happens:

    I Built an empty project  through the "New CCS Project... -> TI_RTOS Examples -> Driver Examples -> CC3200-LAUNCHXL -> Example Projects -> Empty Project" menu item.
    I Change the main source filename from empty.c to empty.cpp.  I then build the project.  The project does not link, and at the end of the build process I get the following:

    warning #10229-D: output section ".data" refers to load symbol "heartBeatFxn" and hence cannot be compressed; compression "rle" is ignored

    undefined first referenced
    symbol in file
    --------- ----------------
    heartBeatFxn C:\Users\Vic\workspace_v6_1\test\Debug\configPkg\package\cfg\empty_pem4.oem4

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "test.out" not built

    >> Compilation failure
    gmake: *** [test.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    Thanks again for your help.

    Vic

  • Vic Berry said:
    I Change the main source filename from empty.c to empty.cpp.  I then build the project.  The project does not link, and at the end of the build process I get the following

    The problem is that the heartBeatFxn function needs to have C linkage, as is referenced by C code in SYS/BIOS.

    Therefore, when empty.c is renamed to empty.cpp the heartBeatFxn function in empty.cpp needs to be changed to have C linkage by adding extern "C":

    extern "C" Void heartBeatFxn(UArg arg0, UArg arg1)
    {
        while (1) {
            Task_sleep((UInt)arg0);
            GPIO_toggle(Board_LED0);
    	}
    }

    With this change, the program links without any warning or error.

    [See http://en.cppreference.com/w/cpp/language/language_linkage]

  • Thank you! That fixed the problem. I should have realized that the SYS/BIOS code was written in straight C. I am sure this solution will help others in this situation. Thanks again.