The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Binutils::Objdump - Perl interface to Binutils objdump


    use Binutils::Objdump;

    # Standard using of objdump. Print the whole information.
    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 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.



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.


Builds a new string of options if $optstr defined. Returns options for objdump in string format.

For example, options can be taken from @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.

By default, if none of object files will not be set, will be used default object file a.out from the current location.

objdumpwrap($label, \&wrapper)

Defines a special wrapper \&wrapper for the correspond label LABEL. Notice, that default wrapper will not be replaced, and so, can be used.

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.


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:

    :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, <>

Slade Maurer, <>


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.