]> sourceware.org Git - libabigail.git/commitdiff
dwarf-reader: Accept SHT_PROGBITS sections in .dynamic segment
authorDodji Seketeli <dodji@redhat.com>
Thu, 22 Sep 2022 15:43:21 +0000 (17:43 +0200)
committerDodji Seketeli <dodji@redhat.com>
Thu, 22 Sep 2022 15:43:21 +0000 (17:43 +0200)
Apparently, some shared libraries from TCL can have a section of type
SHT_PROGBITS in the .dynamic segment.  get_soname_of_elf_file
unexpectedly encounters this when trying to poke at the soname of the
usr/lib/irsim/tcl/diglib.so library and asserts out.  It was expecting
the section to be of type SHT_DYNAMIC, obviously.  The different
between theory and practise, I guess.  Fixed thus.

This fixes the run of the following command:

$ fedabipkgdiff --self-compare --from fc36 irsim

* src/abg-dwarf-reader.cc (get_soname_of_elf_file): Accept
SHT_PROGBITS sections in the dynamic segment.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc

index 21d2e11da40c45d1e9875e97a6712f475096988d..01eca50954bea49157e22b097745fb5dc032fdb4 100644 (file)
@@ -17331,7 +17331,8 @@ get_soname_of_elf_file(const string& path, string &soname)
                             : gelf_fsize (elf, ELF_T_DYN, 1, EV_CURRENT));
           int maxcnt = (shdr != NULL
                         ? shdr->sh_size / entsize : INT_MAX);
-          ABG_ASSERT (shdr == NULL || shdr->sh_type == SHT_DYNAMIC);
+          ABG_ASSERT (shdr == NULL || (shdr->sh_type == SHT_DYNAMIC
+                                      || shdr->sh_type == SHT_PROGBITS));
           Elf_Data* data = elf_getdata (scn, NULL);
           if (data == NULL)
             break;
This page took 0.041775 seconds and 5 git commands to generate.