aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 995a3e0e3edb2bda612979d1fd08036b3246c2c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
ABI Dumper 1.3
==============

ABI Dumper — a tool to dump ABI of an ELF object containing DWARF debug info.

Contents
--------

1. [ About                 ](#about)
2. [ Install               ](#install)
3. [ Usage                 ](#usage)
4. [ Filter public ABI     ](#filter-public-abi)
5. [ Check for ABI changes ](#check-for-abi-changes)

About
-----

The tool is intended to be used with ABI Compliance Checker tool for tracking
ABI changes of a C/C++ library or kernel module: https://github.com/lvc/abi-compliance-checker

The tool is developed by Andrey Ponomarenko.

Install
-------

    sudo make install prefix=/usr

###### Requires

* Perl 5
* Elfutils (eu-readelf)
* GNU Binutils
* Universal Ctags (https://github.com/universal-ctags/ctags)
* Vtable Dumper >= 1.1 (https://github.com/lvc/vtable-dumper)
* ABI Compliance Checker >= 2.2 (https://github.com/lvc/abi-compliance-checker)
* GCC C++

Usage
-----

Input objects should be compiled with `-g -Og` additional options to contain DWARF debug info.

    abi-dumper libTest.so -o ABI.dump
    abi-dumper Module.ko.debug

###### Examples

    abi-dumper lib/libssh.so.3
    abi-dumper drm/nouveau/nouveau.ko.debug

###### Docker

You can try Docker image if the tool is not packaged for your Linux distribution (example for Harfbuzz):

    FROM ebraminio/abi-dumper
    RUN apt update && \
        apt install -y ragel cpanminus && \
        git clone https://github.com/harfbuzz/harfbuzz && cd harfbuzz && \
            CFLAGS="-Og -g" CXXFLAGS="-Og -g" ./autogen.sh && make && cd .. && \
        abi-dumper `find . -name 'libharfbuzz.so.0.*'` && \
        cpanm JSON && \
        perl -le 'use JSON; print to_json(do shift, {canonical => 1, pretty => 1});' ./ABI.dump > ABI.json

###### Adv. usage

  For advanced usage, see output of `--help` option.

Filter public ABI
-----------------

    abi-dumper libTest.so -public-headers PATH

PATH — path to the install tree of a library.

Check for ABI changes
---------------------

    abi-dumper libTest.so.0 -o ABIv0.dump
    abi-dumper libTest.so.1 -o ABIv1.dump
    abi-compliance-checker -l libTest -old ABIv0.dump -new ABIv1.dump