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.

How to find symbol table and string table location in .out file

Hello,

I wanted to find out the symbol names and the addresses in my .out file of the C28xx microcontroller.

To do that, I read COFF document (SPRAAO8) and wrote a small visual c++ program. I followed the file header, optional file header, and section headers in the .out file.

Then I skipped the raw data area, thought that there was no relocation information and symbol table came right after the raw data area, and read symbol tables as the number of symbol table entries specified in the file header.

But many entries in the symbol tables (which I believed so) looked strange, and after I read all the symbol tables, I still did not see anything there that looked like string table.

I should have made some mistakes, but I cannot find the them. Is there any additional document that explains about .out file format than SPRAAO8? Or is there some better way to find out the beginning of the symbol table and string table?

Thank you for your answers!

 

  • After posting this question, I found the answer.

    I first assumed that the number of symbol table entries did not count the Auxilliary Entries. It was wrong. The number of symbol table entries counts both Symbol table entries and Auxilliary Entries.

    Now everything works fine!

     

  • Hello Seok Joo,

    FYI - there is a utility that comes with the compiler (located in the same directory as the compiler binaries) called ofd (filename is ofd2000.exe for C2000). This utility will read the symbol information of an *.out file and output information on it. The good thing about this is that it works for both COFF and ELF output. You can also output the information to xml format for easy parsing. You may want to take a look at this utility to supplement your work. My colleague has generated some cool perl scripts that parse this information to generate a variety of reports. See the below for more information:

    http://processors.wiki.ti.com/index.php/Code_Generation_Tools_XML_Processing_Scripts

    ki

  • Hello Ki-Soo,

    That (ofd2000) is a very good program and very useful to me.

    Thank you for the tip!