Skip to content

stcarrez/ada-bfd

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Ada BFD Library

Build Status Test Status codecov Download License Commits

The Ada-BFD is a library which provides Ada API for GNU Binutils BFD library. It works on any version of GNU Binutils (starting at 2.15). The recommended version for GNU Binutils is at least the 2.34.

The Ada-BFD library allows to:

  • list and scan the ELF sections of an executable or object file,
  • get the content of the ELF sections,
  • get access to the symbol table,
  • use the BFD disassembler

The Ada BFD library is distributed under the GNU GENERAL PUBLIC LICENSE, Version 2 (see COPYING).

The unit tests used by Ada BFD use the Ada Util and Ada Test Util libraries distributed under the Apache License Version 2 (see testutil/LICENSE.txt). They also use the Ahven Unit Test Library distributed under the ISC license (see testutil/LICENSE.Ahven). These unit test libraries are not installed.

Version 1.2.0 - Apr 2021

  • Cleanup build process and use gprinstall for installation
  • Fix build with binutils > 2.34
  • Remove invalid API: Bfd.Set_Error_Handler
  • Remove fake API: Bfd.Symbols.Is_Local_Label_Name

List all versions

Installing and compiling Ada BFD

To compile Ada BFD you'll need:

  • an Ada compiler (GNAT 2020 or gcc 7.3).
  • the binutils 2.34 or higher installed for development. You need the bfd.h include as well as libbfd and libiberty. On Debian systems (including Ubuntu) install the development packages by using:
sudo apt-get install binutils-dev

On NetBSD 9.2, you need to install by using:

sudo pkg_add binutils
sudo pkg_add gettext-lib
sudo pkg_add libiberty

Run the GNU configure command and build the library:

./configure
make
make check

You can install the library by using:

make install

Compiling the Ada BFD samples

Several samples are provided to show how to use the Ada BFD library. To build them, use:

make samples
Example Usage example Description
bfdinfo ./bin/bfdinfo ./bin/bfdgen Open BFD file, get flags, list sections and symbols
sections ./bin/sections ./bin/bfdgen Display the ELF sections with the Bfd.Sections
symbol ./bin/symbol ./bin/bfdgen main Read the symbol table with Bfd.Symbols
disassemble ./bin/disassemble ./bin/bfdgen Disassemble the text section with Bfd.Disassemble

Projects using Ada BFD

Documentation

About

Ada BFD is an Ada binding for the GNU Binutils BFD library. It allows to read binary ELF, COFF files by using the GNU BFD.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •