Documentation for bootimage.pl |
bootimage.pl
Converts a TI executable file (.out) into hexadecimal data contained in arrays written in C. The executable can be in COFF or ELF format.
bootimage.pl [-h] xml file
... OR ...
ofdXX -x out file | perl bootimage.pl
-h : Output usage and quit
--section=name : Only process named sections
--pragma=name : Use a DATA_SECTION pragma to allow placing the section
--cg_xml_version : Print out the version of the cg_xml package in use
If --section is not used, all initialized sections are processed. If --pragma is used, then the number of --pragma options must equal the number of --section options. The Nth section is affected by the Nth pragma.
Short options are also accepted, e.g. -s for --section. Except --cg_xml_version can never be abbreviated.
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
You can avoid creating the XML file by piping the output from OFD into the script ...
ofd6x -x file.out | perl bootimage.pl
On Unix systems, piping the output from OFD works just fine. On Windows systems, however, the pipe method can be much slower.
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
Filtering the XML in this way reduces the amount of data processed by this script, thus making it run faster.
There are two output files: a C file contains the arrays and a header file contains extern declarations of those arrays. The output file names are formed by appending '.c' and '.h', respectively, to the name of the .out file. For example ...
ofd6x -x -o=file.xml file.out
bootimage.pl file.xml
creates 'file.out.c' and 'file.out.h'. If you pipe the the XML in ...
ofd6x -x file.out | perl bootimage.pl
the output files are the same: 'file.out.c' and 'file.out.h'. Note the name of the of the .out file is one of the data items pulled from the XML information.
Documentation for bootimage.pl |