6.4. Inspecting and modifying programs

Donald Knuth 

Donald Knuth

You can inspect and modify object files (including executables) using the GNU Binary Utilities (binutils), a set of tools that also includes the GNU assembler (as) and linker (ld).

Example 6.2. Using objdump

objdump -d lab0 > lab0_dump.txt will disassemble the executable file lab0 and send the results to the file lab0_dump.txt, creating or overwriting the file as necessary.


References to further reading on binutils can be found in Section A.5.5, “More on the GNU Binary Utilities (binutils)”.

Table 6.4. Selected commands from GNU Binary Utilities (binutils)

CommandAction

nm obj_file

Display the symbol table of the given object file

objdump -d obj_file

Disassemble the given object file, sending the results to stdout

strings obj_file

List all strings found in the given object file

strip obj_file

Remove part or all of a given object file's symbol table


Back to Guide main page