edit_script&
variable_changes() const;
+ bool
+ soname_changed() const;
+
const string_function_ptr_map&
deleted_functions() const;
corpus_diff::variable_changes() const
{return priv_->vars_edit_script_;}
+/// Test if the soname of the underying corpus has changed.
+///
+/// @return true iff the soname has changed.
+bool
+corpus_diff::soname_changed() const
+{return !priv_->sonames_equal_;}
+
/// Getter for the deleted functions of the diff.
///
/// @return the the deleted functions of the diff.
unsigned
corpus_diff::length() const
{
- return (!priv_->sonames_equal_
+ return (soname_changed()
+ priv_->deleted_fns_.size()
+ priv_->added_fns_.size()
+ priv_->changed_fns_.size()
test-abicompat/test3-fn-removed-v0.cc \
test-abicompat/test3-fn-removed-v1.cc \
test-abicompat/test3-fn-removed-version-script-0 \
-test-abicompat/test3-fn-removed-version-script-1
+test-abicompat/test3-fn-removed-version-script-1 \
+test-abicompat/libtest4-soname-changed-v0.so \
+test-abicompat/libtest4-soname-changed-v1.so \
+test-abicompat/test4-soname-changed-app \
+test-abicompat/test4-soname-changed-app.cc \
+test-abicompat/test4-soname-changed-v0.cc \
+test-abicompat/test4-soname-changed-v1.cc \
+test-abicompat/test4-soname-changed-report-0.txt
--- /dev/null
+// compile with:
+// bg++ -g -Wall -L. -ltest4-soname-changed-v0 -o test4-soname-change-app test4-soname-change-app.cc
+
+extern void func0();
+
+int
+main()
+{
+ func0();
+}
--- /dev/null
+ELF file 'test4-soname-changed-app' is not ABI compatible with 'libtest4-soname-changed-v1.so' due to differences with 'libtest4-soname-changed-v0.so' below:
+ELF SONAME changed
+Functions changes summary: 0 Removed, 0 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+SONAME changed from 'libtest4-soname-changed.so.0' to 'libtest4-soname-changed.so.1'
+
--- /dev/null
+// Compile this file with:
+// g++ -g -Wall -shared -Wl,-soname=libtest4-soname-changed.so.0 -o libtest4-soname-changed-v0.so test4-soname-changed-v0.cc
+
+void
+func0()
+{
+}
--- /dev/null
+// Compile this file with:
+// g++ -g -Wall -shared -Wl,-soname=libtest4-soname-changed.so.1 -o libtest4-soname-changed-v1.so test4-soname-changed-v1.cc
+
+void
+func0()
+{
+}
+
+void
+func1()
+{
+}
"data/test-abicompat/test3-fn-removed-report-0.txt",
"output/test-abicompat/test3-fn-removed-report-0.txt",
},
+ {
+ "data/test-abicompat/test4-soname-changed-app",
+ "data/test-abicompat/libtest4-soname-changed-v0.so",
+ "data/test-abicompat/libtest4-soname-changed-v1.so",
+ "",
+ "--show-base-names",
+ "data/test-abicompat/test4-soname-changed-report-0.txt",
+ "output/test-abicompat/test4-soname-changed-report-0.txt",
+ },
// This entry must be the last one.
{0, 0, 0, 0, 0, 0, 0}
};
const corpus_diff::diff_stats& s =
changes->apply_filters_and_suppressions_before_reporting();
- if (s.num_func_removed() != 0
+ if (changes->soname_changed()
+ || s.num_func_removed() != 0
|| s.num_vars_removed() != 0
|| s.num_func_syms_removed() != 0
|| s.num_var_syms_removed() != 0
base_name(opts.lib2_path, lib2_path);
}
- bool abi_break_for_sure = s.num_vars_removed()
+ bool abi_break_for_sure = changes->soname_changed()
+ || s.num_vars_removed()
|| s.num_func_removed()
|| s.num_var_syms_removed()
|| s.num_func_syms_removed();