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.

RTOS/AM5728: library contains ELF object files which are incompatible with the TI-COFF output file.

Part Number: AM5728

Tool/software: TI-RTOS

Hi,

we are trying to include PDK libraries compiled like COFF files to our application project for TI RTOS. libraries are:

"..\..\LIB\C66x\Include\ti.csl.a66"
"..\..\LIB\C66x\Include\ti.board.a66
"..\..\LIB\C66x\Include\ti.csl.a66"
"..\..\LIB\C66x\Include\ti.gpio.a66

We have compiled them with coff option in top rules.make. BUT when we try to link them in aplication like so:

C\bin\lnk6x --abi=coffabi -mv=6600 --stack_size=0x800 -g  --heap_size=0x800 -i"..\..\TiCC\Include\lib" -i"..\..\TiCC\Include" --library="..\..\LIB\C66x\dsplib.a66"  -i"..\..\LIB\C66x\Include" --reread_libs --define=CORE1=1 --diag_wrap=off --verbose_diagnostics --warn_sections --xml_link_info="..\..\Programs\MAP\%1_linkInfo.xml" --map_file="..\..\Programs\MAP\%1.map" --relocatable --compress_dwarf=off --strict_compatibility=off "..\..\LIB\C66x\C6000_dsp1.cmd" "..\..\Programs\LNK\%1.LLS" --library="..\..\LIB\C66x\Include\ti.csl.a66" --library="..\..\LIB\C66x\Include\ti.board.a66" -o "..\..\Programs\OUT\%1.out"

THIS hapens:

- Invoking: Ti C6x DSP Linker for "ADC_Mini"
warning: library "..\..\LIB\C66x\Include\ti.csl.a66" contains ELF object files which are incompatible with the TI-COFF output file.  Ensure you are using the proper library.
warning: library "..\..\LIB\C66x\Include\ti.board.a66" contains ELF object files which are incompatible with the TI-COFF output file.  Ensure you are using the proper library.
warning: library "..\..\LIB\C66x\Include\ti.csl.a66" contains ELF object files which are incompatible with the TI-COFF output file.  Ensure you are using the proper library.
warning: library "..\..\LIB\C66x\Include\ti.gpio.a66" contains ELF object files which are incompatible with the TI-COFF output file.  Ensure you are using the proper library.

regardles the fact that this is a warning, the symbols contained in the libraries are not linked. For example we use TI's gpio_init() function, in the application map we have :

UNDEFED    _GPIO_init

This means that linker could not find symbol.Confirming this we have following warning:

..\..\lib\IO_Map.h", line 337: warning: relocation from function "MUL_task_INIT" to symbol "_GPIO_init" overflowed; the 31-bit relocated address 0xdaabf850 is too large to encode in the 21-bit signed PC-Relative field (type = 'R_C60PCR21' (82), file = "MUL.obj", offset = 0x00000008, section = ".text:_MUL_task_INIT")
 GPIO_init();

My question is how do I get real COFF library files without any ELF stuff in them in PDK?

How is it possible that .a66 have ELF inside? Isn't it that .ae66 are elf ?

  • Hi,

    Are you using any Processor SDK RTOS package for AM57x? What release? Those libraries are ELF format. The library we have, has .ae66 extension:

    pdk_am57xx_1_0_12\packages\ti\csl\lib\am572x\c66\release
    pdk_am57xx_1_0_12\packages\ti\drv\gpio\lib\am572x\c66\release
    pdk_am57xx_1_0_12\packages\ti\board\lib\idkAM572x\c66\release

    We don't support COFF library and haven't tried to build COFF library for them. Could your application use ELF format?

    Regards, Eric
  • Hi,
    I am using pdk_am57xx_1_0_10. I am trying to build COFF format. The story about application is that we can't use ELF since we are copying application directly to a memory segment in .hex format whilst RTOS is running. And when we use ELF format, .hex is incomplete. The cinit section is not loaded, ie our variables are not initialized, and application runs amock. We need COFF files (libraries) or a way to initialize application variables in elf .hex file. Is such thing possible? I have read in compiler manual that a special loader is needed ? How do we get(write) this (if COFF files are not available. )

    Thanks!
  • Hi,

    You mentioned:
    "..\..\LIB\C66x\Include\ti.csl.a66"
    "..\..\LIB\C66x\Include\ti.board.a66
    "..\..\LIB\C66x\Include\ti.csl.a66"
    "..\..\LIB\C66x\Include\ti.gpio.a66

    We have compiled them with coff option in top rules.make.

    Can you elaborate how you change the build rules to get those libraries? Or you may attach a build log showing how the source code is compiled and archived into a COFF library? And can you upload one library like ti.gpio.a66 we can check?

    Regards, Eric
  • Hi Eric,

    Please verify your results. Use libinfo6x utility in your cgt to check if .a66 archive contains elf or ti coff v2 files within. If you change only top makefile to format=coff this will ocurr. But if you change the comiler version to 7.2.x and some other setting, which I Will send to you once i get into office tomorow, you will get the coff format but only for gpio. Other components will contain error and will not compile.  For example osal will stop during i2c compilation, etc. More details tomorow. Unfortunately we have a timezone discrpancy..

    So please verify your results and if they are in deed coff, than please be so kind and send them over.

    Kindest regards,

    Nikola

  • Hi,

    It looks that you used "make gpio FORMAT=COFF" to build the C66x coff library. I tried that and I got a .a66 file.
    What is your syntax for libinfo6x? c:\ti\ti-cgt-c6000_8.2.2\bin>libinfo6x.exe c:\ti\pdk_am57xx_1_0_12\packages\ti\drv\gpio\lib\am572x\c66\release\ti.drv.gpio.a66 -o=test.txt?

    I didn't get anything meaningful in the output test.txt. Issue is that we don't support COFF library and never tried to build it although the makefile seems to able to do it.

    Regards, Eric
  • Hi Eric,

    I must apologize, I told you to use wrong tool, I wasn't at the office, so I was wingin it. here it is:

    C:\ti\ti-cgt-c6000_8.2.2\bin\ofd6x.exe -v -o=board.txt ti.drv.gpio.a66

    The output is in correct case:

    ARCHIVE: ti.drv.gpio.a66

    OBJECT FILE:  GPIO_drv.o66

     Object File Information

        File Name:                 GPIO_drv.o66             
        Format:                    TI-COFF Version 2        
        File Type:                 relocatable file         
        Time Stamp:                Wed Dec  5 14:50:27 2018
        Machine:                   TI C6x                   
        Machine Endian:            little endian            
        Entry Point:               0x00000000               
        Vendor:                    Texas Instruments, Inc.  
        Producer:                  Assembler                
        Assembler Version:         7.4.24                   
        Number of Sections:        17                       
        File Length:               10269                    
        File Offset in Archive:    0x17c                    
        Symbol Table File Offset:  0x00002230               
        String Table File Offset:  0x00002668               
        TI-COFF f_flags:           0x00000100               
        CPU Generation:            C6200                    
        Control Data Endian:       little endian            

     Section Information
    ...

    and when compiled with FORMAT=COFF this is the end/wrong result:

    ARCHIVE: ./ti/ti.drv.gpio.a66

    OBJECT FILE:  GPIO_drv.o66

     Object File Information

        File Name:               GPIO_drv.o66           
        Format:                  ELF Version 1          
        File Type:               relocatable file       
        Machine:                 TI C6x                 
        Machine Endian:          little endian          
        Entry Point:             0x00000000             
        Vendor:                  Texas Instruments, Inc.
        Producer:                Assembler              
        Assembler Version:       8.2.2                  
        Number of Sections:      217                    
        File Length:             41736                  
        File Offset in Archive:  0x2680                 
        ELF Class:               32-bit objects         
        ELF e_flags:             0x00000000             

     Section Information

        <0> "(no name)"
           Load Address:        0x00000000  Run Address:        0x00000000

    ...

    To get first, correct result I have changed the following things:

    in: C:\ti\pdk_am57xx_1_0_10\packages\ti\build\Rules.make

    change   CGT_VERSION=8.2.1

    to   CGT_VERSION=7.4.2

    in  C:\ti\pdk_am57xx_1_0_10\packages\ti\build\makerules\build_config.mk

    # Format : Allowed values = COFF | ELF
    FORMAT = COFF

    in  C:\ti\pdk_am57xx_1_0_10\packages\ti\build\makerule:

    (line 58)

    # Derive compiler switch and part of RTS Library name based on FORMAT: COFF/ELF
    ifeq ($(FORMAT),COFF)
      CSWITCH_FORMAT = --abi=coffabi
      RTSLIB_FORMAT = _coff
      CSWITCH_FORMAT = --abi=coffabi
      XDCINTERNAL_DEFINES = -Dxdc_target_types__=ti/targets/std.h
    endif

    Thanks and kind regards,

    Nikola

  • Nikola,

    My archived library also showed as:

    ARCHIVE: c:\ti\pdk_am57xx_1_0_12\packages\ti\drv\gpio\lib\am572x\c66\release\ti.drv.gpio.a66

    OBJECT FILE: GPIO_drv.o66

    Object File Information

    File Name: GPIO_drv.o66
    Format: ELF Version 1
    File Type: relocatable file
    Machine: TI C6x
    Machine Endian: little endian
    Entry Point: 0x00000000
    Vendor: Texas Instruments, Inc.
    Producer: Assembler
    Assembler Version: 8.2.2
    Number of Sections: 217
    File Length: 41788
    File Offset in Archive: 0x2680
    ELF Class: 32-bit objects
    ELF e_flags: 0x00000000

    After you changed the CGT tools and linker options, did the COFF only work for GPIO library or also work for others (CSL, board, etc)?

    Regards, Eric
  • Hi,

    Can you clarify if all libraries can be built with COFF? Any update?

    Regards, Eric
  • Hi Eric,

    this is simply not doable. You have to change too many things in pdk code in order to thing to compile. I have abandoned this aproach and started to write an elf floader which will fill memory properly.

    Thank you very much for help and kind regards,

    Nikola