Documentation for hide_syms.pl |
hide_syms.pl
Hides symbols in a COFF .out or .obj file
hide_syms.pl [options] xml file sym1 sym2 ...
... OR ...
ofdXX -x out file | perl hide_syms.pl [options] sym1 sym2 ...
-h : Output usage and quit
--cg_xml_version : Print out the version of the cg_xml package in use
The symbols to hide must be global and defined in the file (storage class C_EXT). Such symbols are associated with actual code or variable storage in the file. Global symbols only referenced in a file (storage class C_EXTREF) are NOT hidden. Hiding is implemented by changing the storage class of these symbols to static (C_STAT). Future links against this .out or .obj file will result in these symbols not being used to resolve other external references.
To verify the changes to the COFF file, perform steps similar to the following:
Use the nmXX utility to see the symbols in the COFF file. Pipe it through grep (Unix) or find (DOS) to filter for the symbol of interest. Example:
% nm6x -l coff.out | find "_malloc"
[1091] |0x00005100|C_EXT |.text |_malloc
Run the script as described above.
Use the nmXX utility to see the symbol storage class change to C_STAT. Example:
% nm6x -l coff.out | find "_malloc"
[1091] |0x00005100|C_STAT |.text |_malloc
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 hide_syms.pl [options] I<sym1 sym2 ...>
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,header,symbols
Filtering the XML in this way reduces the amount of data processed by this script, thus making it run faster.
This script was written using Perl version 5.8.4. It may not work with earlier revisions of Perl.
Documentation for hide_syms.pl |