Binutils::Objdump - Perl interface to Binutils objdump
use Binutils::Objdump; # Standard using of objdump. Print the whole information. objdumpopt(@ARGV); print objdump(); # Now for the block 'SYMBOL TABLE', will be called # mysymtab subroutine, which will get all lines for this block. sub mysymtab { print "SymTab:\n"; print join "\n", @_; } objdumpwrap("SYMBOL TABLE" => \&mysymtab); objdump();
objdump displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work.
This module provides wrappers for the objdump output information parts, specified by special labels. To each part correspond a special wrapper, which can be extended by your own.
The script odasm is an example of disassembler based on Binutils::Objdump module.
odasm
Sets the new path to objdump if $path defined. Returns current path to the objdump executeable file. By default this path will be defined automatically, but if you have another location for it, you may change it.
$path
Builds a new string of options if $optstr defined. Returns options for objdump in string format.
$optstr
For example, options can be taken from @ARGV.
@ARGV
Executes objdump with string of options objdumpopt() and object files @objfiles, that have to be examinated. Returns the whole information about one or more object files.
objdump
objdumpopt()
@objfiles
By default, if none of object files will not be set, will be used default object file a.out from the current location.
Defines a special wrapper \&wrapper for the correspond label LABEL. Notice, that default wrapper will not be replaced, and so, can be used.
\&wrapper
LABEL
When a label appears, the following lines will be saved till the next matched label. Then this lines will be passed to appropriate wrappers. Be carefull with default labels (if some label includes another, they will be merged).
Default wrapper for dynamic symbol table. Returns lines.
Default wrapper for summary information from the section headers of the object file. Returns lines.
Default wrapper for symbol table entries of the file. Returns lines.
Default wrapper for dynamic relocation entries of the file. Returns lines.
Default wrapper for contents of section $section. Returns lines for correspond section.
$section
Default wrapper for disassembly of section $section. Returns lines for correspond section.
By default will be exported objdump, objdumpopt and objdumpwrap. The following tags can be used to selectively import functions defined in this module:
objdumpopt
objdumpwrap
:ALL objdump() objdumpopt() objdumppath() objdumpwrap() objdump_dynamic_reloc_info() objdump_symtab() objdump_section_headers() objdump_dynamic_symtab() objdump_sec_contents() objdump_sec_disasm()
Alexander Sviridenko, <oleks.sviridenko@gmail.com>
Slade Maurer, <slade@computer.org>
The Binutils::Objdump module is Copyright (c) 2009, 2011 Slade Maurer, Alexander Sviridenko. All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl 5.10.0 README file.
To install Binutils::Objdump, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Binutils::Objdump
CPAN shell
perl -MCPAN -e shell install Binutils::Objdump
For more information on module installation, please visit the detailed CPAN module installation guide.