11.2.3. Code and data sizes example: Dhrystone

The Dhrystone application is located in the examples subdirectory of the ARM Software Development Toolkit. Copy the files into your working directory.

Using command-line tools:

Compile the Dhrystone files, without linking:


armcc -c -DMSC_CLOCK dhry_1.c dhry_2.c

The compiler produces a number of warnings that you can either ignore, or suppress using the -w option. The warnings are generated because the Dhrystone application is coded in Kernighan and Ritchie style C, rather than ANSI C.

Perform the link, with the -info totals option to give a report on the total code and data sizes in the image, broken into separate totals for the object files and library files:


armlink -info totals dhry_1.o dhry_2.o -o dhry

Using the Windows tools

You can use this easier method if you use ADW and are running APM.

Load the Dhrystone project file dhry.apj into the ARM Project Manager (APM).

Change the project setting to produce a release build with a little-endian memory model, using the ARM tools instead of the Thumb tools (see Configuring tools).

Click the Force Build button. This compiles and links the project, automatically generating a summary of the total code and data sizes in the image.

Results

Table 11.1.  Code and data sizes results

code size

inline data

inline strings

const data

RW data

0-init data

debug data

Object totals2136281536048102000
Library totals338885286162439611320
Grand totals36024556215224444113320

Your figures may differ, depending on the version of the compiler, linker, and library.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential