Commit Graph

1248 Commits

Author SHA1 Message Date
Dodji Seketeli
80e78b22e1 Update the COMMIT-LOG-GUIDELINES file
Explain how ChangeLog entries need to refer to each modified
function. Also, give more information more about the expected spirit
of the commit log.

	* COMMIT-LOG-GUIDELINES: Various enhancements.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-22 23:20:12 +02:00
Dodji Seketeli
20ffce5239 Do not run fedabipkgdiff tests if --enable-fedabipkgdiff is turned off
* tests/Makefile.am: Make running runtestfedabipkgdiff be
	dependent on ENABLE_FEDABIPKGDIFF.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-16 13:12:05 +02:00
Chenxiong Qi
aca51e4667 Fix pep8 error
* tools/fedabipkgdiff (build_commandline_args_parser): Fix
          PEP8 error, line is too long.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-16 13:12:05 +02:00
Chenxiong Qi
fe0fa641c8 Use consistent string format
Positional argument specifiers can be omitted for example '{} {}'. This
is introduced in Python 2.7.  Not sure if fedabipkgdiff would be used by
someone with Python 2.6, anyway using consistent string format is a good
way.

	* tools/fedabipkgdiff (download_rpm): do not omit positional
	argument specifiers in string format.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-16 13:12:05 +02:00
Dodji Seketeli
d470e8678f Remove config.h.in from the repository
This is an autogenerated file, it has nothing to do in the repository.

	* config.h.in: Remove from repository.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-16 13:02:12 +02:00
Chenxiong Qi
57dcfb18f5 Bug 19428 - New fedabipkgdiff utility
fedabipkgdiff is a convenient way to compare the ABI of Fedora
packages easily.

The first version of fedabipkgdiff introduced by this patch lets users
perform operations like:

    fedabipkgdiff --from fc23 foo-0.1-1.fc23.x86_64.rpm
    fedabipkgdiff --from fc23 --to fc24 foo
    fedabipkgdiff foo-0.1-1.fc23 foo-0.1-1.fc24
    fedabipkgdiff foo-0.1-1.fc23.i686 foo-0.1-1.fc24.i686
    fedabipkgdiff --all-subpackages foo-0.1-1.fc23 foo-0.1-1.fc24

	* autoconf-archive/ax_compare_version.m4: New file copied from the
	autoconf-archive project.
	* autoconf-archive/ax_prog_python_version.m4: Likewise.
	* autoconf-archive/ax_python_module.m4: Likewise.
	* Makefile.am: Add the new files above to the source distribution.
	* configure.ac: Include the new m4 macros from the autoconf
	archive. Add a new --enable-fedabipkgdiff option. Update the
	report at the end of the configure process to show the status of
	the fedabipkgdiff feature. Add check for prerequisite python
	modules argparse, glob, logging, os, re, shlex, subprocess, sys,
	itertools, urlparse, itertools, shutil, unittest, xdg, koji and
	mock.  These are necessary for the unit test of
	fedabipkgdiff. Generate tests/runtestfedabipkgdiff.py into the
	build directory, from the tests/runtestfedabipkgdiff.py.in input
	file.
	* tools/Makefile.am: Include the fedabipkgdiff to the source
	distribution and install it if the "fedabipkgdiff" feature is
	enabled.
	* tests/Makefile.am: Rename runtestfedabipkgdiff.sh into
	runtestfedabipkgdiff.py.  Add the new runtestfedabipkgdiff.py.in
	autoconf template file in here.
	* tests/runtestfedabipkgdiff.py.in: New unit test file.
	* tools/fedabipkgdiff: New fedabipkgdiff tool.
	* doc/manuals/fedabipkgdiff.rst: New manual.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-13 00:42:36 +02:00
Dodji Seketeli
080b88c9a1 Implement a [suppress_file] suppression directive
abidiff, abipkgdiff and abicompat now recognize a [suppress_file]
directive in suppression specifications.  That directive instructs the
tool to avoid loading some binaries altogether.

This is the first directive that won't act on the result of the
comparison of two binaries.  It actually acts earlier and prevents the
tool from loading some binaries altogether.

The directive looks like:

    [suppress_file]
      # Don't load any library named lib_private*.so
      file_name_regexp = lib_private.*\\.so

This prevents the tool from loading (and thus comparing) any library
which name matches the pattern "lib_private*.so".

    [suppress_file]
      # Only load libraries name lib_public*.so
      file_name_not_regexp = lib_public.*\\.so

This instructs the tool to only load (and compare) files which name
match the pattern "lib_public*.so".

	* doc/manuals/libabigail-concepts.rst: Document the new
	'suppress_file' directive.
	* include/abg-suppression.h (file_suppression): Define new class.
	(file_suppression_sptr): Define new typedef.
	(is_file_suppression, file_is_suppressed): Declare new functions.
	* src/abg-suppression.cc ():
	(read_file_suppression, is_file_suppression, file_is_suppressed):
	Define new functions.
	(file_suppression::{file_suppression, suppresses_file,
	~file_suppression}): Define new member functions.
	* tools/abidiff.cc (main): If a suppression specification
	suppresses one of the input files, then do not perform the
	comparison.
	* tools/abipkgdiff.cc (compare): If a suppression specification
	suppresses a file that is to be compared, then do not perform the
	comparison.
	* tools/abicompat.cc (create_diff_context): New static function.
	(perform_compat_check_in_normal_mode)
	(perform_compat_check_in_weak_mode): Adjust to take a context in
	parameter.  Do not create a diff context here anymore, do not load
	suppression files here either.
	(main): Use the new create_diff_context to create a diff context
	and initialize it, including loading suppression specifications.
	If any suppression specification suppresses a file to load, then
	do not load perform any compatibility checking.  Adjust
	invocations of perform_compat_check_in_weak_mode and
	perform_compat_check_in_normal_mode to pass the diff context.
	* tests/data/test-diff-suppr/test0-type-suppr-3.suppr: New test
	input.
	* tests/data/test-diff-suppr/test0-type-suppr-4.suppr: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-5.suppr: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-5.txt:
	Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-6.suppr: Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-6.txt:
	Likewise.
	* tests/data/test-diff-suppr/test0-type-suppr-report-7.txt:
	Likewise.
	* tests/test-diff-suppr.cc (in_out_specs): Use the new test
	inputs.
	* tests/data/test-abicompat/test0-fn-changed-1.suppr: New test
	input.
	* tests/data/test-abicompat/test0-fn-changed-report-3.txt:
	Likewise.
	* tests/test-abicompat.cc (in_out_specs):: Use the new test
	inputs.
	* tests/data/Makefile.am: Add the new test material to source
	distribution.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 12:39:26 +02:00
Dodji Seketeli
7cd624a1cd Split suppression engine off of abg-comparison.{cc,h}
Until now, the suppression engine was part of the comparison engine.
The code of both was in the abg-comparison.{cc,h} files.

For the sake of greater modularity, this patch separates the suppression
engine from the comparison engine.  The suppression engine now lives
in include/abg-suppression.h and src/abg-suppression.cc.  The patch
also updates logical consumers of the suppression engine to adapt them
to the change.

	* include/Makefile.am: Add abg-suppression.h to source
	distribution.
	* include/abg-comparison.h: Remove abg-ini.h include directive.
	(suppression_sptr, suppressions_type): Move these typedefs to
	abg-fwd.h.
	(class suppression_base, type_suppression)
	(type_suppression::insertion_range)
	(type_suppression::insertion_range::boundary)
	(type_suppression::insertion_range::integer_boundary)
	(type_suppression::insertion_range::fn_call_expr_boundary)
	(function_suppression, function_suppression::parameter_spec)
	(variable_suppression): Move these type definitions to the new
	abg-suppression.h.
	(read_suppressions, is_type_suppression, is_integer_boundary)
	(is_fn_call_expr_boundary, is_function_suppression)
	(is_variable_suppression, operator&)
	(operator|): Move these function declarations to the new
	abg-suppression.h.
	(type_suppression, type_suppression_sptr, type_suppression_type)
	(function_suppression, function_suppression_sptr)
	(function_suppressions_type, variable_suppression)
	(variable_suppression_sptr, variable_suppressions_type): Move
	these forward declaration and typedefs to the new
	abg-suppression.h.
	(diff_context::suppressions): Adjust return type to
	suppr::suppressions_type&.
	(diff_context::add_suppression): Adjust parameter type to
	suppr::suppressions_sptr.
	(diff_context::add_suppressions): Adjust parameter type
	suppr::suppressions_type&.
	(is_type_diff, is_decl_diff, is_var_diff, is_function_decl_diff)
	(is_pointer_diff, is_reference_diff, is_fn_parm_diff)
	(is_base_diff, is_child_node_of_function_parm_diff)
	(is_child_node_of_base_diff): Declare these new functions.  They
	were previously static, local to abg-comparison.cc only.  Now they
	need to be exported because they are used by the suppression
	engine's code that now lives in its one files.
	* include/abg-fwd.h (suppr::{suppression_base, suppression_sptr,
	suppressions_type}): Forward declare these here.
	* include/abg-suppression.h (class suppression_base)
	(type_suppression, type_suppression::insertion_range)
	(type_suppression::insertion_range::boundary)
	(type_suppression::insertion_range::integer_boundary)
	(type_suppression::insertion_range::fn_call_expr_boundary)
	(function_suppression, function_suppression::parameter_spec)
	(variable_suppression): Move these type definitions here, in the
	namespace suppr.
	(read_suppressions, is_type_suppression, is_integer_boundary)
	(is_fn_call_expr_boundary, is_function_suppression)
	(is_variable_suppression, operator&)
	(operator|): Move these function decalration here, in the
	namespace suppr.
	(type_suppression_sptr, type_suppressions_type)
	(function_suppression_sptr, function_suppressions_type)
	(variable_suppression_sptr, variable_suppressions_type): Move
	these typedefs here, in the namespace suppr.
	* src/Makefile.am: add src/abg-suppression.cc to source
	distribution.
	* src/abg-comparison.cc (is_type_diff, is_decl_diff, is_var_diff)
	(is_function_decl_diff, is_pointer_diff, is_reference_diff)
	(is_reference_or_pointer_diff, is_fn_parm_diff, is_base_diff)
	(is_child_node_of_function_parm_diff, is_child_node_of_base_diff):
	Export these functions.
	(*suppression*): Move all the suppression-related definitions to
	the new abg-suppression.cc.
	* src/abg-suppression.cc: New file. Contains all the *suppression*
	definitions from src/abg-comparison.cc, that are put in the suppr
	namespace.
	* tools/abicompat.cc: Adjust.
	* tools/abidiff.cc: Likewise.
	* tools/abipkgdiff.cc: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 12:29:57 +02:00
Dodji Seketeli
70d34beb69 Fix indentation for abidiff manual
* doc/manuals/abidiff.rst: Fix indentation for the --suppression
	paragraph.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 12:29:40 +02:00
Dodji Seketeli
d1c2199e08 Add several shortcuts to options for abicompat
This patch adds the following convenience command line options
shortcuts:

  --suppr, --appd, --libd1, --libd2

for the following command line options:

  --suppressions, --app-debug-info-dir, --lib-debug-info-dir1,
    --lib-debug-info-dir2

The patch also updates the documentation accordingly.

	* doc/manuals/abicompat.rst: Update documentation.
	* tools/abicompat.cc (display_usage): Update help strings.
	(parse_command_line): Add shortcuts --suppr, --appd, --libd1 and
	--libd2.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 12:29:33 +02:00
Dodji Seketeli
a3420853ac Update copyright year in tools/abicompat.cc
* tools/abicompat.cc: Update copyright years to 2016.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 12:29:26 +02:00
Dodji Seketeli
086cf5e580 Fix mention of tool's name in abidiff error message
When a suppression specification file was not found, from the command line
of abidiff, the error message fails to mention the name of the tool.

This patch fixes that.

	* src/abg-tools-utils.cc (emit_prefix): Try to emit the prefix
	only if the program name was provided.
	* abidiff.cc (maybe_check_suppression_files): Pass the name of the
	tool to the check_file function.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 11:14:41 +02:00
Dodji Seketeli
e2f777164f Update copyright year on abg-comparison.h
* include/abg-comparison.h: Update copyright year.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 11:14:35 +02:00
Dodji Seketeli
028d5bc867 Doc not show classes' inherited members in apidoc
* doc/api/libabigail.doxy: Don't show inherited member functions
	or variables of a given class.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 11:13:24 +02:00
Dodji Seketeli
5fb593009d Fix typo in concept manual
* doc/manuals/libabigail-concepts.rst: Do not refer to abidiff
	specifically for suppressions because several tools use
	suppressions.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 11:13:13 +02:00
Dodji Seketeli
ee5e358c87 Fix indentation in concepts manual
* doc/manuals/libabigail-concepts.rst: Fix indentation.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-08 11:12:54 +02:00
Dodji Seketeli
19463fc485 Add some apidoc to dwarf_reader
* include/abg-dwarf-reader.h (namespace dwarf_reader): Add apidoc.
	(enum elf_type): Add an apidoc for each enumerator.
	* src/abg-dwarf-reader.cc (get_type_of_elf_file): Add an apidoc
	for the 'type' parameter.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-05-06 18:18:07 +02:00
Dodji Seketeli
fa5a5acbbc [abipkgdiff] Show SONAME of removed/added libraries
When abipkgdiff says that a library was added or removed, it doesn't
tell us about the SONAME of that library, making it hard for the user
to guess that maybe this adding/removal is probably due to a SONAME
change.

This patch fixes that.

	* tools/abipkgdiff.cc (abi_diff::{added,removed}_binaries): Change
	the type of these data member from vector<string> to
	vector<elf_file_sptr>.
	(compare): Adjust.  Show the soname of added/removed binaries.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-28 13:19:36 +02:00
Dodji Seketeli
b885e6283f Bug 20015 - support file_name_not_regexp and soname_not_regexp in suppr specs
The supression directives suppress_type, suppress_function and
suppress_variable support the two properties below, among others:

    file_name_regexp = <some-regexp>
    soname_regexp = <some-regexp>

When the regular expression matches either the file name or the
soname, then the suppression directive is activated.

This patch adds the support for these two additional properties for
these suppression directives:

    file_name_not_regexp = <some-regexp>
    soname_not_regexp = <some-regexp>

These activate the current suppression directive if the regular
expression does *NOT* match the file name or soname.

This is very helpful to express change report suppressions like:

    "suppress all ABI change reports for all libraries but those with
    file names (or sonames) with the pattern libfoobar.*"

	* include/abg-comparison.h
	(suppression_base::{get,set}_file_name_not_regex_str): Declare new
	member functions.
	(suppression_base::{get,set}_soname_not_regex_str): Likewise.
	(suppression_base::{names,sonames}_of_binaries_match): Likewise.
	* src/abg-comparison.cc
	(suppression_base::priv::get_file_name_regex): Fix comment.
	(suppression_base::priv::get_file_name_not_regex): New member
	function.
	(suppression_base::priv::get_soname_regex): Fix comment.
	(suppression_base::priv::get_soname_not_regex): New member
	function.
	(suppression_base::{get,set}_file_name_not_regex_str): Define new
	member functions.
	(suppression_base::{get,set}_soname_not_regex_str): Likewise.
	(suppression_base::{names,sonames}_of_binaries_match): Likewise.
	These got factorized out of type_suppression::suppresses_type,
	function_suppression::suppresses_function,
	function_suppression::suppresses_function_symbol,
	variable_suppression::suppresses_variable,
	variable_suppression::suppresses_variable_symbol.
	(type_suppression::suppresses_type): Use the new
	suppression_base::{names,sonames}_of_binaries_match.
	(read_type_suppression): Read the new file_name_not_regexp and
	soname_not_regexp properties.
	(function_suppression::{suppresses_function,
	suppresses_function_symbol}): Use the new
	suppression_base::{names,sonames}_of_binaries_match.
	(read_function_suppression): Read the new file_name_not_regexp and
	soname_not_regexp properties.
	(variable_suppression::{suppresses_variable,
	variable_suppression::suppresses_variable_symbol}): Use the new
	suppression_base::{names,sonames}_of_binaries_match.
	(read_variable_suppression): Use the new
	suppression_base::{names,sonames}_of_binaries_match.
	* doc/manuals/libabigail-concepts.rst: Document the new
	file_name_not_regexp and soname_not_regexp suppression properties.
	* tests/data/test-diff-suppr/test24-soname-report-10.txt: New test
	reference output.
	* tests/data/test-diff-suppr/test24-soname-report-11.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-12.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-13.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-14.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-15.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-16.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-9.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-10.txt: New test input.
	* tests/data/test-diff-suppr/test24-soname-suppr-11.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-12.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-13.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-14.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-15.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-16.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-9.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-2.txt: New test
	reference output.
	* tests/data/test-diff-suppr/test29-soname-report-3.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-4.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-5.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-6.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-7.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-8.txt: Likewise.
	* tests/data/test-diff-suppr/test29-suppr-2.txt: New test input.
	* tests/data/test-diff-suppr/test29-suppr-3.txt: Likewise.
	* tests/data/test-diff-suppr/test29-suppr-4.txt: Likewise.
	* tests/data/test-diff-suppr/test29-suppr-5.txt: Likewise.
	* tests/data/test-diff-suppr/test29-suppr-6.txt: Likewise.
	* tests/data/test-diff-suppr/test29-suppr-7.txt: Likewise.
	* tests/data/test-diff-suppr/test29-suppr-8.txt: Likewise.
	* tests/data/Makefile.am: Add the new test material to source
	distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Make this test harness
	run over the new test inputs.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-27 23:58:50 +02:00
Dodji Seketeli
8d670d6dde Make API documentation of thread pools visible
* include/abg-workers.h: Document the workers namespace, the task,
	queue and queue::task_done_notify types.
	* src/abg-workers.cc: Move the documentation of the thread_pool
	module inside the abigail::worker namespace, so that references to
	task and queue types (which are also in the abigail::worker
	namespace) can be resolved in the apidoc.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-27 23:58:50 +02:00
Dodji Seketeli
716dbd5898 Update documentation to require doxygen and python-sphinx for building
* COMPILING: Add python-sphinx to the set of required packages to
	build the documentation.
	* doc/website/mainpage.txt: Update the website to mention doxygen
	and python-sphinx for documentation.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-27 15:53:40 +02:00
Dodji Seketeli
4148297251 Add doc, info, man and html-doc targets to generate documentation
* Makefile.am: Add info, man and html-doc targets to generate
	documentation in info, man and html formats.  If you want to
	generate them all, then the doc target is the one to be used.
	* COMPILING: Add documentation for the above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-27 15:39:53 +02:00
Dodji Seketeli
2529f84ae0 Bug 19964 - Cannot load function aliases on ppc64
Registering alias of functions on ppc64 seems to be broken since this
commit:

    11f5dba Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64

This is because the ppc64-specific code tries to register a symbol
alias that was already registered as an alias by the arch-agnostic
code.

This patch fixes that.

	* src/abg-dwarf-reader.cc (read_context::load_symbol_maps): While
	filling the ppc64-specific "function-entry-address => symbol" map,
	if we stumble accross a function-entry-address that belongs to an
	alias of 'symbol', then assume the alias must have been registered
	as an alias already, by the platform-agnostic code.  Do not try to
	register the alias again.
	* tests/data/Makefile.am: Add the new test input binaries to the
	source distribution.
	* tests/data/test-diff-dwarf/libtest36-ppc64-aliases-v0.so: New
	binary test input.
	* tests/data/test-diff-dwarf/libtest36-ppc64-aliases-v1.so: Likewise.
	* tests/data/test-diff-dwarf/test36-ppc64-aliases-report-0.txt:
	New test reference output.
	* tests/data/test-diff-dwarf/test36-ppc64-aliases-v0.cc: Source
	code for the new binary test input above.
	* tests/data/test-diff-dwarf/test36-ppc64-aliases-v1.cc: Likewise.
	* tests/test-diff-dwarf.cc: Add the new test input to the list of
	test inputs considered by this test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-25 14:48:11 +02:00
Sinny Kumari
8944ceb9ef Bug 19961 - Distinguish between PI executable and shared library
In the ELF format, Position Independent Executables (aka PIE) and
shared libraries are marked as being of type ET_DYN.  So just looking
at the type of the ELF file is not enough to discriminate a position
independent executable from a shared library.

And this is the problem.  Libabigail just looks at the type of the ELF
file to discriminate PIE binaries from shared libraries binaries.

So it treats both kinds of binaries as being shared libraries.  When
we run abipkgdiff with the --dso-only option, the tool considers both
PIEs and shared libraries, even though the intent of the --dso-only
option is have the tool consider shared libraries only.

With this patch, we introduce a new enumerator ELF_TYPE_PI_EXEC (to
the elf_type enum) for PIE binaries.  From now on, a file will be
properly recognized as being of the ELF_TYPE_DSO kind only if it is a
shared library.

	* include/abg-dwarf-reader.h (elf_type): Add new enumerator
	ELF_TYPE_PI_EXEC.
	* src/abg-dwarf-reader.cc
	(lookup_data_tag_from_dynamic_segment): New function for
	data tag lookup in dynamic segment of an elf
	(elf_file_type): Return ELF_TYPE_PI_EXEC file type for
	a PI executable.
	(get_elf_file_type): Change this to take an elf handle.
	(get_type_of_elf_file): New function that got factorized out of ...
	(load_dt_soname_and_needed): ... this one.
	* tools/abipkgdiff.cc (create_maps_of_package_content): Also
	consider ELF_TYPE_PI_EXEC file type.
	(compare): Likewise.
	* tests/test-diff-pkg.cc (in_out_specs): Test case additions
	* tests/data/Makefile.am: Include test files
	* tests/data/test-diff-pkg/tarpkg-1-dir1.tar.gz: New test data
	* tests/data/test-diff-pkg/tarpkg-1-dir2.tar.gz: New test data
	* tests/data/test-diff-pkg/tarpkg-1-report-0.txt: New test result

Signed-off-by: Sinny Kumari <sinny@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-20 17:05:16 +02:00
Dodji Seketeli
b6c6a65c5a Update website to 1.0.rc4
* doc/website/mainpage.txt: Update tarball reference to 1.0.rc4

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-17 21:19:35 +02:00
Dodji Seketeli
b035a8f25f Bump current version number to 1.0.rc5
* configure.ac: Bump current version number to 1.0.rc5

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-17 21:16:52 +02:00
Dodji Seketeli
47aa22a3a8 Add a 'release' target to main Makefile
Add a release target that tags and uploads the release.

	* Makefile.am: Add tarball, upload-release-only, upload-release
	and release targets.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-17 21:14:31 +02:00
Dodji Seketeli
4c62b17887 Update ChangeLog for 1.0.rc4
* ChangeLog: Update automatically by running "make
	update-changelog"

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-16 21:59:23 +02:00
Dodji Seketeli
585179c6ac Update NEWS for 1.0.rc4
* NEWS: Update for 1.0.rc4

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-16 21:58:27 +02:00
Dodji Seketeli
415ac35666 Fix typos in the suppression specifications manual
* doc/manuals/libabigail-concepts.rst: Fix typos.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-16 21:53:26 +02:00
Dodji Seketeli
f6c182bb56 Ease use of soname_regexp/file_name_regexp in suppr specs
In a suppression specification, soname_regexp or file_name_regexp
cannot be the only property of a suppression directive.  For instance,
the suppression specification below won't work:

    [suppress_type]
      # suppress all change reports about *any type* from the library
      # libtestfoo.so
      file_name_regexp = libtestfoo.so

This is because as documented in the manual, the suppression directive
'suppress_type' requires that some other properties be specified.  For
instance, the below would work:

    [suppress_type]
      name_regexp = .*
      file_name_regexp

This was done on purpose to prevent folks from inadvertently
suppressing too much of change report bits.

But experience is showing that this is surprising some users.  And in
hindsight, I kind of agree it's surprising.

So this patch allows the first example to work, as seems to be
expected.

The patch allows the first example to work for the suppress_function
and suppress_variable directive too.

	* doc/manuals/libabigail-concepts.rst: Update the manual to
	reflect the changes in the suppression_type, suppress_function and
	suppress_variable directives.
	* src/abg-comparison.cc (read_type_suppression): Accept that
	the suppress_type directive contains only file_name_regexp
	or the soname_regexp property.
	(read_function_suppression): Likewise for the suppress_function
	directive.
	(read_variable_suppression): Likewise for the suppress_variable
	directive.
	* tests/data/test-diff-suppr/libtest29-soname-v0.so: New binary
	test input.
	* tests/data/test-diff-suppr/libtest29-soname-v1.so: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-5.txt: New
	reference test output.
	* tests/data/test-diff-suppr/test24-soname-report-6.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-7.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-report-8.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-5.txt: New test
	suppression file.
	* tests/data/test-diff-suppr/test24-soname-suppr-6.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-7.txt: Likewise.
	* tests/data/test-diff-suppr/test24-soname-suppr-8.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-report-0.txt: New
	reference test output.
	* tests/data/test-diff-suppr/test29-soname-report-1.txt: Likewise.
	* tests/data/test-diff-suppr/test29-soname-v0.cc: Source code for
	the new binary output above.
	* tests/data/test-diff-suppr/test29-soname-v1.cc: Likewise.
	* tests/data/test-diff-suppr/test29-suppr-0.txt: New test
	suppression file.
	* tests/data/test-diff-suppr/test29-suppr-1.txt: Likewise.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Make this test harness
	run over the new test input above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-04-16 21:47:20 +02:00
Dodji Seketeli
d06c4cd2ca Fix comments in tests/test-diff-pkg.cc
* tests/test-diff-pkg.cc: Fix the wording of the introductory
	comments.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-31 10:13:49 +02:00
Dodji Seketeli
11f5dbaab2 Bug 19885 - Cannot associates a function DIE to a symbol on powerpc64
On powerpc 64 ELFv1, the address of a function is different from the
address of the entry point of that function.  The value of a en ELF
symbol represents the address of the function, whereas the
DW_AT_low_pc DWARF attribute of a function DIE points to the entry
point address of the function.  So to get the symbol a function's
DW_AT_low_pc points to, one needs to get the address of the function
*from* the address of its entry point.

More precisely, on ppc64, the address of a function is the address of
a function descriptor.  The function descriptor is a set of three 64
bits addresses.  The first element of the triplet is the function
entry pointer address.  So to get the symbol a given function entry
point address belongs to, one must get to the function descriptor
which contains said function entry point address.  And function
descriptors are in the ".opd" special section.

Unfortunately, Libabigail's  ELF/DWARF reader has no knowledge of all
this.  So it cannot get the symbol of a given function DWARF
description.  So it considers all functions as having no ELF symbols.
So it shows no ABI change pertaining to function sub-types on ppc64.

This patch makes Libabigail support function descriptors on ppc64 so
it can detect changes on function sub-types there.

	* src/abg-dwarf-reader.cc (read_context::{opd_section_,
	fun_entry_addr_sym_map_}): New data members.
	(read_context::read_context): Initialize the new opd_section_ data
	member.
	(read_context::{find_opd_section,
	lookup_ppc64_elf_fn_entry_pointer_address,
	fun_entry_addr_sym_map_sptr, fun_entry_addr_sym_map,
	elf_architecture_is_ppc64, elf_architecture_is_big_endian}): New
	member functions.
	(read_context::lookup_elf_fn_symbol_from_address): Adjust to use
	the new read_context::fun_entry_addr_sym_map() function.
	(read_context::load_symbol_maps): Populate the function entry
	addresses -> symbol map, for ppc64 ELFv1.
	(read_context::load_elf_properties): Renamed
	read_context::load_remaining_elf_data into this.
	(read_corpus_from_elf): Load elf properties before trying to load
	elf symbols information.
	* tests/data/test-diff-filter/libtest32-struct-change-v0.so: New
	binary test input, compiled for ppc64le.
	* tests/data/test-diff-filter/libtest32-struct-change-v1.so: Likewise.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-report0.txt:
	New test reference output.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-v0.c:
	Source code of the new binary test input above.
	* tests/data/test-diff-filter/test32-ppc64le-struct-change-v1.c:
	Likewise.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-filter.cc (in_out_spec): Make this test harness
	run over the new test input binaries above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-30 20:17:42 +02:00
Dodji Seketeli
b1af2c72b8 Fix logs in abipkgdiff and add some more
* tools/abipkgdiff.cc (compare): Fix logs to make them more
	readable in a multithreaded context.
	(create_maps_of_package_content): Likewise.  Add logs about the
	number of elf files found in a given directory.  Add logs about
	skipping files.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-25 13:52:02 +01:00
Dodji Seketeli
67435cf6cd Bug 19867 - abipkgdiff skips symbolic links
When comparing two directories, abipkgdiff skips symbolic links
pointing to ELF binaries altogether.  It only consider regular files.
This is a problem when abipkgdiff is given two directories that only
contain symbolic links.  In that case, abipkgdiff just performs no
comparison.

This patch makes abipkgdiff resolve the symbolic link to its target
file.

	* include/abg-tools-utils.h (maybe_get_symlink_target_file_path):
	Declare new function.
	* src/abg-tools-utils.cc (get_stat): Use lstat here, not stat.
	Update comment.
	* tools/abipkgdiff.cc (first_package_tree_walker_callback_fn)
	(second_package_tree_walker_callback_fn): Follow symbolic links to
	elf files to get their target paths, and only work with that
	target path.
	(maybe_get_symlink_target_file_path): Define new function.
	* test-diff-pkg/symlink-dir-test1-report0.txt New test material.
	* test-diff-pkg/symlink-dir-test1/dir1/symlinks/foo.o: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir1/symlinks/libfoo.so: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir1/targets/foo.c: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir1/targets/foo.o: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir1/targets/libfoo.so: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir2/symlinks/foo.o: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir2/symlinks/libfoo.so: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir2/targets/foo.c: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir2/targets/foo.o: Likewise.
	* test-diff-pkg/symlink-dir-test1/dir2/targets/libfoo.so: Likewise.
	* tests/data/Makefile.am: Add the new test material to source
	distribution.
	* tests/test-diff-pkg.cc (in_out_spec): Run this test harness
	over the new test material above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-25 13:52:02 +01:00
Dodji Seketeli
f55a1a13c4 Fix typo on the web page
* doc/website/mainpage.txt: Fix typo.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-21 13:18:44 +01:00
Roland McGrath
5cfa9af797 Fix typo in configure --enable-deb help text
* configure.ac: Fix typo in --enable-deb usage text.

Signed-off-by: Roland McGrath <roland@hack.frob.com>
2016-03-21 13:04:51 +01:00
Dodji Seketeli
f2f3aa9f0f Bug 19846 - variable decl associated with the wrong debug info section
The decl of a member variable which DIE is in the main debug info
section is being associated with the alternate debug info section,
just because the specification DIE of the variable is in the alternate
debug info section.

This patch associates the decl of a member variable with the same
debug info section as its DIE, not with the debug info section of its
specification DIE.

Note that I am not adding a regression test for this because the
reproducer RPMs given in the bug for this issue are too big and slow
to analyze.

	* src/abg-dwarf-reader.cc (build_ir_node_from_die): Associate the
	decl of the variable to the same debug info file (alternate or
	not) as the DIE, not as its specification DIE.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-18 22:45:59 +01:00
Dodji Seketeli
223cb6117f Fix typo in the manual of abidiff
* doc/manuals/abidiff.rst: Fix typo.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-18 20:17:25 +01:00
Dodji Seketeli
908999c422 Fix typos in comments in src/abg-dwarf-reader.cc
* src/abg-dwarf-reader.cc (read_context::{die_type_map,
	is_wip_class_die_offset, is_wip_function_type_die_offset}): Fix
	typo in comments.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-18 20:13:26 +01:00
Dodji Seketeli
10b029b385 Bug 19844 - Cannot try to canonicalize a type that is being constructed
maybe_canonicalize_type aborts because the assertion that
read_context::lookup_type_from_die_offset should always return a type
is violated.  read_context::lookup_type_from_die_offset is called on
the offset of a DIE of a type that is being constructed.  The problem
is that that fonction only looks in the map of types that are fully
constructed.

This patch addresses the issue by making
read_context::lookup_type_from_die_offset look up class and function
types being constructed as well.

While doing that I had to add maps for class and function types being
constructed and that are in the alternate debug info section.  I
adjusted the accessors for class and function types accordingly.  The
code using those accessors was adjusted accordingly as well.

The patch also prevents maybe_canonicalize_type for DIEs which no type
was built for, in buid_ir_node_from_die.  This is particularly for
DW_TAG_class_type and DW_TAG_structure_type DIEs.

	* src/abg-dwarf-reader.cc
	(read_context::{alternate_die_wip_classes_map_,
	alternate_die_wip_function_types_map_}): New data members.
	(read_context::lookup_type_from_die_offset): Lookup WIP class and
	function types too.
	(read_context::{die_wip_classes_map, die_wip_function_types_map}):
	Take a flag saying if we should get the map for the alternate
	debug info section or not.
	(read_context::{is_wip_class_die_offset,
	is_wip_function_type_die_offset}): Take a flagy saying if the DIE
	is in the alternate debug info section or not.
	(build_class_type_and_add_to_ir, build_function_type)
	(maybe_canonicalize_type): Adjust.
	(build_ir_node_from_die): Do not call maybe_canonicalize_type on
	type DIEs which no type has been constructed for.
	* tests/data/test-diff-pkg/gtk2-debuginfo-2.24.22-5.el7.i686.rpm:
	New test input.
	* tests/data/test-diff-pkg/gtk2-debuginfo-2.24.28-8.el7.i686.rpm:
	Likewise.
	* tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.22-5.el7.i686.rpm:
	Likewise.
	* tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.28-8.el7.i686.rpm:
	Likewise.
	* tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.22-5.el7.i686--gtk2-immodule-xim-2.24.28-8.el7.i686-report-0.txt:
	New test reference output.
	* tests/data/Makefile.am: Add the new test material to the source
	distribution.
	* tests/test-diff-pkg.cc (in_out_spec): Make this test harness run
	on the new test input above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-18 18:15:29 +01:00
Dodji Seketeli
61a0a8b2c0 Fix a typo in include/abg-tools-utils.h
* include/abg-tools-utils.h (enum abidiff_status): Fix typo in
	comment.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-16 20:50:45 +01:00
Dodji Seketeli
78f4661f42 Update copyright dates for the manuals
* doc/manuals/conf.py: Update copyright years.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-16 20:50:45 +01:00
Dodji Seketeli
ec99d6eb1d More docs about ABIDIFF_ABI_INCOMPATIBLE_CHANGE
In the manual of abidiff, explain the kind of changes that flip the
ABIDIFF_ABI_INCOMPATIBLE_CHANGE flag.

	* doc/manuals/abidiff.rst: Explain the kind of changes that flip
	the ABIDIFF_ABI_INCOMPATIBLE_CHANGE flag.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-16 20:50:45 +01:00
Dodji Seketeli
7bd768af64 Fix typos on the web page
* doc/website/mainpage.txt: Fix typos.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-09 21:28:11 +01:00
Dodji Seketeli
5ec998554a Bump version number to 1.0.rc4
* configure.ac: Bump version number to 1.0.rc4

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-08 14:36:41 +01:00
Dodji Seketeli
d611e96460 Fix potential race condition in test-diff-pkg.cc
The output of several tar file tests for abipkgdiff have the same
name.  This is can be a race condition now that these tests are run in
parallel, potentially.

This patch fixes the issue by giving each test output file a different
name.

	* tests/test-diff-pkg.cc (in_out_spec): Make the tar format tests
	output have different names.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-08 14:34:58 +01:00
Dodji Seketeli
b35b89e7c2 Updated website to point to 1.0.rc3 tarball
* doc/website/mainpage.txt: Updated website to point to 1.0.rc3
	tarball.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-08 11:43:30 +01:00
Dodji Seketeli
dbf6c14f46 Update ChangeLog before 1.0.rc3
* ChangeLog: Update for 1.0.rc3

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-08 08:47:32 +01:00
Dodji Seketeli
9afc906822 Update NEWS file for 1.0.rc3
* NEWS: update for 1.0.rc3

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-08 08:42:37 +01:00