BFD (Binary File Descriptor)

A Ruby C extension (and gem) for the GNU Binutils libbfd library.

Note: this is not a complete implementation of the BFD API; it is only intended for use with the Opcodes or Opdis Ruby extensions.


The standard C extension build process is used:

bash# ruby extconf.rb bash# make

Note that the Ruby headers must be installed. On Ubuntu, these are in the ruby-dev or ruby1.9-dev package.

The gem is built using the standard gem build command:

bash# gem build Bfd.gemspec

The top-level Makefile supports each of these builds with the commands 'make' and 'make gem'.

bash# make # builds C extension bash# make gem # builds the gem


Extended examples are provided in the 'examples' directory. The following code snippets give a brief overview of using the BFD extension.

require 'BFD'

t ='/tmp/a.out') t.symbols.values.each { |sym| puts sym }'/tmp/a.out') do |tgt| tgt.sections.each { |name, sec| puts sec } end