From Fedora Project Wiki

(Created page with "== Introduction == The <code>abidiff</code> program compares the [https://en.wikipedia.org/wiki/Application_binary_interface ABIs] of two C/C++ ELF binaries. It then emits a...")
 
No edit summary
Line 42: Line 42:


[https://sourceware.org/libabigail/manual/abidiff.html The manual of the abidiff command]
[https://sourceware.org/libabigail/manual/abidiff.html The manual of the abidiff command]
[[Category:ABI]]

Revision as of 18:37, 18 November 2015

Introduction

The abidiff program compares the ABIs of two C/C++ ELF binaries. It then emits a textual report that precisely describes the changes that potentially make the ELF binaries ABI incompatible. Note that abidiff analyzes the ABI of the binaries by essentially looking at their accompanying debug information. Therefore, the 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.

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