02.05.2013 Views

Basics of the MKS Toolkit - Mks.com

Basics of the MKS Toolkit - Mks.com

Basics of the MKS Toolkit - Mks.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Programming<br />

Examining Symbol Tables<br />

Miscellaneous Commands<br />

The nm <strong>com</strong>mand displays <strong>the</strong> symbol table in <strong>com</strong>piled code. The file<br />

being examined must have <strong>the</strong> extension .obj (indicating an object<br />

file), .lib (indicating a library), or .exe (indicating an executable<br />

file). An executable file must contain a symbol table such as <strong>the</strong> one<br />

put out by CodeView.<br />

The format <strong>of</strong> <strong>the</strong> nm <strong>com</strong>mand is<br />

nm files...<br />

The output lists <strong>the</strong> names found in <strong>the</strong> symbol table. Each name is<br />

preceded by a flag letter which indicates <strong>the</strong> type <strong>of</strong> <strong>the</strong> symbol. For<br />

example, initialized global data names are marked with a D while<br />

uninitialized ones are marked with a B. The <strong>com</strong>plete list <strong>of</strong> flag<br />

letters is given in <strong>the</strong> description <strong>of</strong> nm in <strong>the</strong> <strong>MKS</strong> <strong>Toolkit</strong> Utilities<br />

Reference.<br />

The size <strong>com</strong>mand lets you determine <strong>the</strong> size <strong>of</strong> various parts <strong>of</strong> an<br />

object module, library, or executable file. Its format is simply<br />

size file<br />

The od <strong>com</strong>mand can dump <strong>the</strong> contents <strong>of</strong> a file in several different<br />

formats.<br />

od file<br />

dumps a file in octal.<br />

od -h file<br />

dumps <strong>the</strong> file in hexadecimal. Both <strong>of</strong> <strong>the</strong>se may be useful if you<br />

want to check on <strong>the</strong> actual contents <strong>of</strong> a non-text file. O<strong>the</strong>r output<br />

formats are available; see <strong>the</strong> od online reference page in <strong>the</strong> <strong>MKS</strong><br />

<strong>Toolkit</strong> Utilities Reference.<br />

30 <strong>MKS</strong> <strong>Toolkit</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!