.\" Man page generated from reStructuredText. . .TH "ABIDIFF" "1" "Nov 24, 2016" "" "Libabigail" .SH NAME abidiff \- compare ABIs of ELF files . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .sp abidiff compares the Application Binary Interfaces (ABI) of two shared libraries in \fI\%ELF\fP format. It emits a meaningful report describing the differences between the two ABIs. .sp For a comprehensive ABI change report that includes changes about function and variable sub\-types, the two input shared libraries must be accompanied with their debug information in \fI\%DWARF\fP format. Otherwise, only \fI\%ELF\fP symbols that were added or removed are reported. .SH INVOCATION .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C abidiff [options] .ft P .fi .UNINDENT .UNINDENT .SH ENVIRONMENT .sp abidiff loads two default suppression specifications files, merges their content and use it to filter out ABI change reports that might be considered as false positives to users. .INDENT 0.0 .IP \(bu 2 Default system\-wide suppression specification file .sp It\(aqs located by the optional environment variable LIBABIGAIL_DEFAULT_SYSTEM_SUPPRESSION_FILE. If that environment variable is not set, then abidiff tries to load the suppression file $libdir/libabigail/libabigail\-default.abignore. If that file is not present, then no default system\-wide suppression specification file is loaded. .IP \(bu 2 Default user suppression specification file. .sp It\(aqs located by the optional environment LIBABIGAIL_DEFAULT_USER_SUPPRESSION_FILE. If that environment variable is not set, then abidiff tries to load the suppression file $HOME/.abignore. If that file is not present, then no default user suppression specification is loaded. .UNINDENT .SH OPTIONS .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fB\-\-help | \-h\fP .sp Display a short help about the command and exit. .IP \(bu 2 \fI\-\-version | \-v\fP .sp Display the version of the program and exit. .IP \(bu 2 \fB\-\-debug\-info\-dir1 | \-\-d1\fP <\fIdi\-path1\fP> .sp For cases where the debug information for \fIfirst\-shared\-library\fP is split out into a separate file, tells \fBabidiff\fP where to find that separate debug information file. .sp Note that \fIdi\-path\fP must point to the root directory under which the debug information is arranged in a tree\-like manner. Under Red Hat based systems, that directory is usually \fB/usr/lib/debug\fP\&. .sp Note also that this option is not mandatory for split debug information installed by your system\(aqs package manager because then \fBabidiff\fP knows where to find it. .IP \(bu 2 \fB\-\-debug\-info\-dir2 | \-\-d2\fP <\fIdi\-path2\fP> .sp Like \fB\-\-debug\-info\-dir1\fP, this options tells \fBabidiff\fP where to find the split debug information for the \fIsecond\-shared\-library\fP file. .IP \(bu 2 \fB\-\-headers\-dir1 | \-\-hd1\fP .sp Specifies where to find the public headers of the first shared library that the tool has to consider. The tool will thus filter out ABI changes on types that are not defined in public headers. .IP \(bu 2 \fB\-\-headers\-dir2 | \-\-hd2\fP .sp Specifies where to find the public headers of the second shared library that the tool has to consider. The tool will thus filter out ABI changes on types that are not defined in public headers. .IP \(bu 2 \fB\-\-stat\fP .sp Rather than displaying the detailed ABI differences between \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP, just display some summary statistics about these differences. .IP \(bu 2 \fB\-\-symtabs\fP .sp Only display the symbol tables of the \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP\&. .IP \(bu 2 \fB\-\-deleted\-fns\fP .sp In the resulting report about the differences between \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP, only display the globally defined functions that got deleted from \fIfirst\-shared\-library\fP\&. .IP \(bu 2 \fB\-\-changed\-fns\fP .sp In the resulting report about the differences between \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP, only display the changes in sub\-types of the global functions defined in \fIfirst\-shared\-library\fP\&. .IP \(bu 2 \fB\-\-added\-fns\fP .sp In the resulting report about the differences between \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP, only display the globally defined functions that were added to \fIsecond\-shared\-library\fP\&. .IP \(bu 2 \fB\-\-deleted\-vars\fP .sp In the resulting report about the differences between \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP, only display the globally defined variables that were deleted from \fIfirst\-shared\-library\fP\&. .IP \(bu 2 \fB\-\-changed\-vars\fP .sp In the resulting report about the differences between \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP, only display the changes in the sub\-types of the global variables defined in \fIfirst\-shared\-library\fP .IP \(bu 2 \fB\-\-added\-vars\fP .sp In the resulting report about the differences between \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP, only display the global variables that were added (defined) to \fIsecond\-shared\-library\fP\&. .IP \(bu 2 \fB\-\-no\-linkage\-name\fP .sp In the resulting report, do not display the linkage names of the added, removed, or changed functions or variables. .IP \(bu 2 \fB\-\-no\-show\-locs\fP .UNINDENT .INDENT 0.0 .INDENT 3.5 Do not show information about where in the \fIsecond shared library\fP the respective type was changed. .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 \fB\-\-no\-unreferenced\-symbols\fP .sp In the resulting report, do not display change information about function and variable symbols that are not referenced by any debug information. Note that for these symbols not referenced by any debug information, the change information displayed is either added or removed symbols. .IP \(bu 2 \fB\-\-no\-default\-suppression\fP .sp Do not load the \fI\%default suppression specification files\fP\&. .IP \(bu 2 \fB\-\-suppressions | \-\-suppr\fP <\fIpath\-to\-suppressions\fP> .sp Use a suppression specification file located at \fIpath\-to\-suppressions\fP\&. Note that this option can appear multiple times on the command line. In that case, all of the provided suppression specification files are taken into account. .sp Please note that, by default, if this option is not provided, then the \fI\%default suppression specification files\fP are loaded . .IP \(bu 2 \fB\-\-drop\fP <\fIregex\fP> .sp When reading the \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP ELF input files, drop the globally defined functions and variables which name match the regular expression \fIregex\fP\&. As a result, no change involving these functions or variables will be emitted in the diff report. .IP \(bu 2 \fB\-\-drop\-fn\fP <\fIregex\fP> .sp When reading the \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP ELF input files, drop the globally defined functions which name match the regular expression \fIregex\fP\&. As a result, no change involving these functions will be emitted in the diff report. .IP \(bu 2 \fB\-\-drop\-var\fP <\fIregex\fP> .sp When reading the \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP ELF input files, drop the globally defined variables matching a the regular expression \fIregex\fP\&. .IP \(bu 2 \fB\-\-keep\fP <\fIregex\fP> .sp When reading the \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP ELF input files, keep the globally defined functions and variables which names match the regular expression \fIregex\fP\&. All other functions and variables are dropped on the floor and will thus not appear in the resulting diff report. .IP \(bu 2 \fB\-\-keep\-fn\fP <\fIregex\fP> .sp When reading the \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP ELF input files, keep the globally defined functions which name match the regular expression \fIregex\fP\&. All other functions are dropped on the floor and will thus not appear in the resulting diff report. .IP \(bu 2 \fB\-\-keep\-var\fP <\fIregex\fP> .sp When reading the \fIfirst\-shared\-library\fP and \fIsecond\-shared\-library\fP ELF input files, keep the globally defined which names match the regular expression \fIregex\fP\&. All other variables are dropped on the floor and will thus not appear in the resulting diff report. .IP \(bu 2 \fB\-\-harmless\fP .sp In the diff report, display only the harmless changes. By default, the harmless changes are filtered out of the diff report keep the clutter to a minimum and have a greater change to spot real ABI issues. .IP \(bu 2 \fB\-\-no\-harmful\fP .sp In the diff report, do not display the harmful changes. By default, only the harmful changes are displayed in diff report. .IP \(bu 2 \fB\-\-redundant\fP .sp In the diff report, do display redundant changes. A redundant change is a change that has been displayed elsewhere in the report. .IP \(bu 2 \fB\-\-no\-redundant\fP .sp In the diff report, do \fINOT\fP display redundant changes. A redundant change is a change that has been displayed elsewhere in the report. This option is switched on by default. .IP \(bu 2 \fB\-\-no\-architecture\fP .sp Do not take architecture in account when comparing ABIs. .IP \(bu 2 \fB\-\-dump\-diff\-tree\fP .UNINDENT .INDENT 0.0 .INDENT 3.5 After the diff report, emit a textual representation of the diff nodes tree used by the comparison engine to represent the changed functions and variables. That representation is emitted to the error output for debugging purposes. Note that this diff tree is relevant only to functions and variables that have some sub\-type changes. Added or removed functions and variables do not have any diff nodes tree associated to them. .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 \fB\-\-stats\fP .sp Emit statistics about various internal things. .IP \(bu 2 \fB\-\-verbose\fP .sp Emit verbose logs about the progress of miscellaneous internal things. .UNINDENT .UNINDENT .UNINDENT .SH RETURN VALUES .sp The exit code of the \fBabidiff\fP command is either 0 if the ABI of the binaries being compared are equal, or non\-zero if they differ or if the tool encountered an error. .sp In the later case, the exit code is a 8\-bits\-wide bit field in which each bit has a specific meaning. .sp The first bit, of value 1, named \fBABIDIFF_ERROR\fP means there was an error. .sp The second bit, of value 2, named \fBABIDIFF_USAGE_ERROR\fP means there was an error in the way the user invoked the tool. It might be set, for instance, if the user invoked the tool with an unknown command line switch, with a wrong number or argument, etc. If this bit is set, then the \fBABIDIFF_ERROR\fP bit must be set as well. .sp The third bit, of value 4, named \fBABIDIFF_ABI_CHANGE\fP means the ABI of the binaries being compared are different. .sp The fourth bit, of value 8, named \fBABIDIFF_ABI_INCOMPATIBLE_CHANGE\fP means the ABI of the binaries compared are different in an incompatible way. If this bit is set, then the \fBABIDIFF_ABI_CHANGE\fP bit must be set as well. If the \fBABIDIFF_ABI_CHANGE\fP is set and the \fBABIDIFF_INCOMPATIBLE_CHANGE\fP is \fINOT\fP set, then it means that the ABIs being compared might or might not be compatible. In that case, a human being needs to review the ABI changes to decide if they are compatible or not. .sp Note that, at the moment, there are only a few kinds of ABI changes that would result in setting the flag \fBABIDIFF_ABI_INCOMPATIBLE_CHANGE\fP\&. Those ABI changes are either: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 the removal of the symbol of a function or variable that has been defined and exported. .IP \(bu 2 the modification of the index of a member of a virtual function table (for C++ programs and libraries). .UNINDENT .UNINDENT .UNINDENT .sp With time, when more ABI change patterns are found to \fIalways\fP constitute incompatible ABI changes, we will adapt the code to recognize those cases and set the \fBABIDIFF_ABI_INCOMPATIBLE_CHANGE\fP accordingly. So, if you find such patterns, please let us know. .sp The remaining bits are not used for the moment. .SH USAGE EXAMPLES .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP 1. 3 Detecting a change in a sub\-type of a function: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ cat \-n test\-v0.cc 1 // Compile this with: 2 // g++ \-g \-Wall \-shared \-o libtest\-v0.so test\-v0.cc 3 4 struct S0 5 { 6 int m0; 7 }; 8 9 void 10 foo(S0* /*parameter_name*/) 11 { 12 // do something with parameter_name. 13 } $ $ cat \-n test\-v1.cc 1 // Compile this with: 2 // g++ \-g \-Wall \-shared \-o libtest\-v1.so test\-v1.cc 3 4 struct type_base 5 { 6 int inserted; 7 }; 8 9 struct S0 : public type_base 10 { 11 int m0; 12 }; 13 14 void 15 foo(S0* /*parameter_name*/) 16 { 17 // do something with parameter_name. 18 } $ $ g++ \-g \-Wall \-shared \-o libtest\-v0.so test\-v0.cc $ g++ \-g \-Wall \-shared \-o libtest\-v1.so test\-v1.cc $ $ ../build/tools/abidiff libtest\-v0.so libtest\-v1.so Functions changes summary: 0 Removed, 1 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some indirect sub\-type change: [C]\(aqfunction void foo(S0*)\(aq has some indirect sub\-type changes: parameter 0 of type \(aqS0*\(aq has sub\-type changes: in pointed to type \(aqstruct S0\(aq: size changed from 32 to 64 bits 1 base class insertion: struct type_base 1 data member change: \(aqint S0::m0\(aq offset changed from 0 to 32 $ .ft P .fi .UNINDENT .UNINDENT .IP 2. 3 Detecting another change in a sub\-type of a function: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ cat \-n test\-v0.cc 1 // Compile this with: 2 // g++ \-g \-Wall \-shared \-o libtest\-v0.so test\-v0.cc 3 4 struct S0 5 { 6 int m0; 7 }; 8 9 void 10 foo(S0& /*parameter_name*/) 11 { 12 // do something with parameter_name. 13 } $ $ cat \-n test\-v1.cc 1 // Compile this with: 2 // g++ \-g \-Wall \-shared \-o libtest\-v1.so test\-v1.cc 3 4 struct S0 5 { 6 char inserted_member; 7 int m0; 8 }; 9 10 void 11 foo(S0& /*parameter_name*/) 12 { 13 // do something with parameter_name. 14 } $ $ g++ \-g \-Wall \-shared \-o libtest\-v0.so test\-v0.cc $ g++ \-g \-Wall \-shared \-o libtest\-v1.so test\-v1.cc $ $ ../build/tools/abidiff libtest\-v0.so libtest\-v1.so Functions changes summary: 0 Removed, 1 Changed, 0 Added function Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 function with some indirect sub\-type change: [C]\(aqfunction void foo(S0&)\(aq has some indirect sub\-type changes: parameter 0 of type \(aqS0&\(aq has sub\-type changes: in referenced type \(aqstruct S0\(aq: size changed from 32 to 64 bits 1 data member insertion: \(aqchar S0::inserted_member\(aq, at offset 0 (in bits) 1 data member change: \(aqint S0::m0\(aq offset changed from 0 to 32 $ .ft P .fi .UNINDENT .UNINDENT .IP 3. 3 Detecting that functions got removed or added to a library: .INDENT 3.0 .INDENT 3.5 .sp .nf .ft C $ cat \-n test\-v0.cc 1 // Compile this with: 2 // g++ \-g \-Wall \-shared \-o libtest\-v0.so test\-v0.cc 3 4 struct S0 5 { 6 int m0; 7 }; 8 9 void 10 foo(S0& /*parameter_name*/) 11 { 12 // do something with parameter_name. 13 } $ $ cat \-n test\-v1.cc 1 // Compile this with: 2 // g++ \-g \-Wall \-shared \-o libtest\-v1.so test\-v1.cc 3 4 struct S0 5 { 6 char inserted_member; 7 int m0; 8 }; 9 10 void 11 bar(S0& /*parameter_name*/) 12 { 13 // do something with parameter_name. 14 } $ $ g++ \-g \-Wall \-shared \-o libtest\-v0.so test\-v0.cc $ g++ \-g \-Wall \-shared \-o libtest\-v1.so test\-v1.cc $ $ ../build/tools/abidiff libtest\-v0.so libtest\-v1.so Functions changes summary: 1 Removed, 0 Changed, 1 Added functions Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 Removed function: \(aqfunction void foo(S0&)\(aq {_Z3fooR2S0} 1 Added function: \(aqfunction void bar(S0&)\(aq {_Z3barR2S0} $ .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH AUTHOR Dodji Seketeli .SH COPYRIGHT 2014-2016, Red Hat, Inc. .\" Generated by docutils manpage writer. .