From Fedora Project Wiki

Revision as of 08:35, 20 November 2015 by Dodji (talk | contribs) (→‎Introduction)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

The abidiff program compares the ABIs of two C/C++ ELF binaries.

It does so by analyzing the content the ELF binaries themselves, including their debug information. It can pinpoint ABI changes, categorize them into harmless and potentially harmful (i.e ABI incompatible) changes, and report about the potentially harmful changes in a way that makes it easy for programmers to understand which part of the source code change induced the ABI change.

Note that as abidiff analyzes the ABI of the binaries by essentially looking at their accompanying debug information, said binaries must have been compiled with the debug info generation feature activated in the compiler. For GCC compilers for instance, the -g option must have been provided.

Note also that abidiff is written using the Libabigail foundation library.

Requirements

It is assumed that you already have a development environment setup which can build packages. Other than that all that is required is the package libabigail.

$ sudo yum install libabigail
(or as root)
# yum install libabigail

Procedure

The abidiff program compares the ABIs of two versions of ELF binaries that we shall call libfoo1.so and libfoo2.so, compiled with debug info generation turned on.

Comparing

Binaries with embedded debug information

To compare the ABIs of libfoo1.so and libfoo2.so, here is the command line:

abidiff libfoo1.so libfoo2.so

A report with details of the ABI changes is emitted on the standard output of the command line.

Binaries with split debug information

Sometimes he debug information can be split from the binary and put somewhere else, in a separate directory. On Fedora, the root directory under which all split debug info is located is /usr/lib/debug.

So if the debug information of libfoo1.so and libfoo2.so is put under that directory, here is the command line to tell abidiff about it:

abidiff --d1 /usr/lib/debug --d2 /usr/lib/debug libfoo1.so libfoo2.so

External links

The manual of the abidiff command