From: Dodji Seketeli Date: Tue, 26 Jan 2021 18:19:01 +0000 (+0100) Subject: dwarf-reader: Support fast DW_FORM_line_strp string comparison X-Git-Tag: libabigail-1.8.2~12 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=4dab7cd9700aad7f19ab0343da031f861724f492;p=libabigail.git dwarf-reader: Support fast DW_FORM_line_strp string comparison When running Libabigail on Fedora 34 it appeared that we don't support DW_FORM_line_strp in the fast string comparison scheme, during DIE de-duplication. This patch fixes that. * src/abg-dwarf-reader.cc (compare_dies_string_attribute_value): Support DW_FORM_line_strp. * tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt: New reference test output. * tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm: New test input. * tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm: Likewise. * tests/data/Makefile.am: Add the new testing material above to source distribution. * tests/test-diff-pkg.cc (in_out_specs): Add the test input above to this harness. Signed-off-by: Dodji Seketeli --- diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 099bff75..4b39e966 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -9414,19 +9414,23 @@ compare_dies_string_attribute_value(const Dwarf_Die *l, const Dwarf_Die *r, ABG_ASSERT(l_attr.form == DW_FORM_strp || l_attr.form == DW_FORM_string || l_attr.form == DW_FORM_GNU_strp_alt - || form_is_DW_FORM_strx(l_attr.form)); + || form_is_DW_FORM_strx(l_attr.form) + || l_attr.form == DW_FORM_line_strp); ABG_ASSERT(r_attr.form == DW_FORM_strp || r_attr.form == DW_FORM_string || r_attr.form == DW_FORM_GNU_strp_alt - || form_is_DW_FORM_strx(r_attr.form)); + || form_is_DW_FORM_strx(r_attr.form) + || l_attr.form == DW_FORM_line_strp); if ((l_attr.form == DW_FORM_strp && r_attr.form == DW_FORM_strp) || (l_attr.form == DW_FORM_GNU_strp_alt && r_attr.form == DW_FORM_GNU_strp_alt) || (form_is_DW_FORM_strx(l_attr.form) - && form_is_DW_FORM_strx(r_attr.form))) + && form_is_DW_FORM_strx(r_attr.form)) + || (l_attr.form == DW_FORM_line_strp + && r_attr.form == DW_FORM_line_strp)) { // So these string attributes are actually pointers into a // string table. The string table is most likely de-duplicated diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 56a4c4a1..a23dbc63 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -1785,6 +1785,9 @@ test-diff-pkg/cogl-debuginfo-1.22.8-2.fc33.x86_64.rpm \ test-diff-pkg/glibc-2.32-3.fc33.aarch64-self-check-report-0.txt \ test-diff-pkg/glibc-2.32-3.fc33.aarch64.rpm \ test-diff-pkg/glibc-debuginfo-2.32-3.fc33.aarch64.rpm \ +test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt \ +test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm \ +test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm \ \ test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm \ test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm \ diff --git a/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt b/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt new file mode 100644 index 00000000..05d079f4 --- /dev/null +++ b/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt @@ -0,0 +1 @@ +==== SELF CHECK SUCCEEDED for 'sshpass' ==== diff --git a/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm b/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm new file mode 100644 index 00000000..6ba415b5 Binary files /dev/null and b/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm differ diff --git a/tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm b/tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm new file mode 100644 index 00000000..c17bf0bf Binary files /dev/null and b/tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm differ diff --git a/tests/test-diff-pkg.cc b/tests/test-diff-pkg.cc index b18e09de..a1aa16ca 100644 --- a/tests/test-diff-pkg.cc +++ b/tests/test-diff-pkg.cc @@ -658,6 +658,18 @@ static InOutSpec in_out_specs[] = "output/test-diff-pkg/glibc-2.32-3.fc33.aarch64-self-check-report-0.txt" } , + { + "data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm", + "data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm", + "--self-check", + "", + "data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm", + "data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm", + "", + "", + "data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt", + "output/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt" + }, #endif // WITH_RPM_4_15 #endif //WITH_RPM