]> sourceware.org Git - systemtap.git/commitdiff
translate.cxx (get_unwind_data): Only get .eh_frame for SHT_PROGBITS sections.
authorMark Wielaard <mjw@redhat.com>
Thu, 3 Nov 2011 20:20:47 +0000 (21:20 +0100)
committerMark Wielaard <mjw@redhat.com>
Thu, 3 Nov 2011 20:24:53 +0000 (21:24 +0100)
This is really a bug somewhere in the toolchain. Only observed on s390x
for the kernel debuginfo vmlinux image. But it is a good sanity check in
general. See also rhbz#751197.

translate.cxx

index 64de6661a62655e53156bf60f4b0a11cff569085..403e902483912d0eeec7463a633d1de7228d4536 100644 (file)
@@ -5307,7 +5307,9 @@ static void get_unwind_data (Dwfl_Module *m,
       bool eh_frame_hdr_seen = false;
       shdr = gelf_getshdr(scn, &shdr_mem);
       const char* scn_name = elf_strptr(elf, ehdr->e_shstrndx, shdr->sh_name);
-      if (!eh_frame_seen && strcmp(scn_name, ".eh_frame") == 0)
+      if (!eh_frame_seen
+         && strcmp(scn_name, ".eh_frame") == 0
+         && shdr->sh_type == SHT_PROGBITS)
        {
          data = elf_rawdata(scn, NULL);
          *eh_frame = data->d_buf;
@@ -5320,7 +5322,9 @@ static void get_unwind_data (Dwfl_Module *m,
            *eh_addr = shdr->sh_addr;
          eh_frame_seen = true;
        }
-      else if (!eh_frame_hdr_seen && strcmp(scn_name, ".eh_frame_hdr") == 0)
+      else if (!eh_frame_hdr_seen
+              && strcmp(scn_name, ".eh_frame_hdr") == 0
+              && shdr->sh_type == SHT_PROGBITS)
         {
           data = elf_rawdata(scn, NULL);
           *eh_frame_hdr = data->d_buf;
This page took 0.041179 seconds and 5 git commands to generate.