Documentation for sectti.pl

NAME

sectti.pl

SYNOPSIS

Prints the name, size, and base address of each section in an object (.obj), executable (.out), or library (.lib) file. Any section not loaded or used on the target is ignored.

USAGE

sectti.pl [options] xml file

   ... OR ...

ofdXX -x obj, out, or lib file | perl sectti.pl [options]

OPTIONS

 -h               : Output usage and quit
 --csv            : CSV format
 --no_header      : Disable writing out header row in CSV format
 --cg_xml_version : Print out the version of the cg_xml package in use

CREATING XML INPUT

OFD stands for Object File Display utility. Examples include ofd6x for C6000 and ofd55 for C5500.

Use the -x option of OFD to create the XML file. Example ...

      ofd6x -x -o=file.xml file.out

Alternatively, pipe the output from OFD into the script ...

      ofd6x -x file.out | perl sectti.pl

OFD OPTIONS

Recent releases of OFD support options for filtering the XML output down to what is strictly of interest. The best options to use in combination with this script are:

  -x --xml_indent=0 --obj_display=none,sections,header,segments

Filtering the XML in this way reduces the amount of data processed by this script, thus making it run faster.

If you are using an older version of OFD which does not support all those options, try:

  -x --xml_indent=0 --obj_display=none,sections,header

That will work fine, so long as you are not working with ELF object files.

If you are working with ELF object files, and you have an older version of OFD, then try:

  -x --xml_indent=0 --obj_display=norawdata,nosymbols

These options are less than ideal, but still helpful.

SIZING UNITS

Sizes are always reported as the number of 8-bit bytes. On targets that can address 8-bit bytes, this is not an issue. For other targets, this may be an issue. On C5400, for example, which can only address 16-bit words, to compute the number of target words used by a section, divide the size reported by sectti.pl by 2 i.e. 124 bytes == 62 words.

CSV FORMAT

CSV stands for Comma Separated Values. It is a text-based file format that can be loaded into many useful utilities, most notably MS-Excel. Get the data in CSV format with the option --csv.

CSV FORMAT FIELDS

The fields you get vary with whether the input file is a library, and whether it executable.

If the file is a library, the library name is output at the beginning of each line. Otherwise, no library name is output.

If the file is not a library and is executable (as indicated by the file header flags), the load and run address of each section is at the end of each line. Otherwise, addresses are not output.

Fields always output are file name, section name, section type (CODE, DATA, UDATA == Uninitialized Data), and section size.

CSV HEADER ROW

By default, an appropriate CSV header row is output. Disable with the option --no_header. Use this option to accumulate data across multiple files ...

   ofd6x -x first.lib  | perl sectti.pl --csv > results.csv
   ofd6x -x second.lib | perl sectti.pl --csv --no_header >> results.csv
   ...

PERL VERSION DETAILS

This script was written using Perl version 5.8.3. It may not work with earlier revisions of Perl.

 Documentation for sectti.pl