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.

Unexpected differences when using objdiff.exe to compare two RTS libraries



Hello, I am attempting to use objdiff.exe from cg_xml 2.32 to compare two RTS libraries that I built on my PC. I am expecting the libraries to be the same (you'll see why shortly). Here are the exact steps that I used.

  1. Installed C6000 CGT 7.4.15 (latest 7.4 release) to d:\ti\c6000_7.4.15.
  2. Opened a command prompt at d:\ti\c6000_7.4.15\lib.
  3. Used mklib to build the same RTS library twice:
    1. d:\ti\c6000_7.4.15\lib > set CCS_UTILS_DIR=c:/ti/ccsv6/utils
    2. d:\ti\c6000_7.4.15\lib > set PATH=d:/ti/c6000_7.4.15/bin
    3. d:\ti\c6000_7.4.15\lib > mklib --pattern=rts6600_elf.lib --name=local1.lib
    4. d:\ti\c6000_7.4.15\lib > mklib --pattern=rts6600_elf.lib --name=local2.lib
  4. Used objdiff to compare the two libraries that I just built:
    1. d:\ti\c6000_7.4.15\lib > d:\ti\cg_xml\bin\objdiff.exe local1.lib local2.lib ofd6x

The output of objdiff is attached, but the following snippet shows two typical differences:

**********************************************************************
Filename xsinh.obj
**********************************************************************
======================================================================
Comparing Sections : section = __TI_ICODE : elf32_shdr
======================================================================
         Differences:           local1.lib                 local2.lib
             sh_size:               0x1262                     0x1263
**********************************************************************
Filename xvalues.obj
**********************************************************************
======================================================================
Comparing Sections : section = __TI_ICODE
======================================================================
        Raw data is different

Files are different

objdiff.txt

My question is, why is objdiff.exe showing these differences? I assume they are false positives, but I don't know how to make it ignore them. Thanks for your help!

Best regards,
Dave

  • You can ignore these differences in the __TI_ICODE section.  And I'll show you how to configure objdiff to do that.  But, first, I'm sure you want to know why these differences can be ignored.  To explain that, I need to establish some background.

    I-code stands for intermediate code.  Compiling a file proceeds in multiple stages.  The representation of the source between these stages is the intermediate code.  It is a binary file.  The format is not an industry standard, but specific to TI compilers. 

    When the RTS library is built, the I-code is embedded in it.  It is contained in the section named __TI_ICODE.  The idea was take advantage of it with yet to be implemented optimization levels.  That never happened for the C6000 compiler.  This __TI_ICODE section is never used.  Future releases do not embed I-code in the RTS object files. 

    When mklib builds the library, it creates a temporary directory, copies all the C source and header files into that temp directory, then performs all of the builds there.  The I-code puts the full path to the source file in a few different places.  When you run mklib multiple times, different temporary directories are created, used, then deleted. 

    The net effect is that the __TI_ICODE section, from different invocations of mklib, contains the full path to different temporary directories.  The differences among these paths are what you see when you use objdiff. 

    Since the __TI_ICODE section is not used, you can ignore it in the comparison.  Here is how to do that.  Create a text file with contents like this:

    # config.txt
    
    SKIP_BY_NAME = __TI_ICODE  # skip the section named __TI_ICODE

    Then add --config_file=config.txt to the objdiff command line. 

    Thanks and regards,

    -George

  • George, thank you for the solution, and especially for the detailed explanation. It is greatly appreciated!

    Best regards,
    Dave