The Green Hills gcompare Utility Program compares the code size of two input files and prints a report. An input file can be an ASCII text file, an object file, an object file library, or an executable file. If an input file is a text file, it consists of lines in the following format:
name1 number1
name2 number2
...
Each name/number pair is on its own line, separated by blanks or tabs.
If an input file is an object file, an object library file, or an executable file, gcompare automatically runs gfunsize -gcompare -all (or another command specified by the -x option) to produce a text file to compare.
You can mix all input file types with no restrictions, including files for different target CPUs.
The gcompare utility first reads both input files. For any name which does not exist in both files, gcompare prints a warning, unless -w is specified. For each name which exists in both files, gcompare compares the code size of the old and new numbers. If the old number is worse (larger is worse unless -i is specified) gcompare writes a line to the output report file containing the name, old number, new number, and percentage by which the new number is better.
main 32 28 -14%
gcompare [options] oldfile newfile
options gcompare options, listed on the following page.
-help Display information about all options.
-i Invert comparison. With -i, larger is better. Without -i, smaller is better.
-r Print a 2-column report, with comparisons sorted both from worst to best and from best to worst.
-l Print a report, with comparisons sorted from worst to best.
-L Format for 132 column landscape mode. Default is 80 column portrait mode.
-v Verbose mode. Print all comparisons. Without -v, only print comparisons for which newfile is worse than oldfile.
-x cmd Specify the command to execute on a non-ASCII input file. The default -x command is:
-x "gfunsize -gcompare -all"
-z Do not show cases where files are the same.
If the -r, -l, or -v options are used, all comparisons are shown, regardless of the result of the comparison. With -r, two reports are shown side by side in two columns. The left column is sorted best first, and the right column is sorted worst first.
The output, especially in -r mode, can require many columns. The -L option formats the gcompare output for 132 columns instead of the default 80 columns. On a UNIX system, use the command lpr -L to print the resulting report in landscape mode.